Skip to content

Instantly share code, notes, and snippets.

@zacharytyhacz
Created May 22, 2025 02:20
Show Gist options
  • Save zacharytyhacz/a2cddfb6348be9c41c05c1de26fd12be to your computer and use it in GitHub Desktop.
Save zacharytyhacz/a2cddfb6348be9c41c05c1de26fd12be to your computer and use it in GitHub Desktop.
finally lua vim rc
-- ~/.config/nvim/init.lua
-- bootstrap lazy
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ "habamax/vim-godot", ft = "gdscript" },
{ "[email protected]:github/copilot.vim.git" }
})
local opt = vim.opt
opt.number = false
opt.tabstop = 2
opt.shiftwidth = 2
opt.expandtab = true
opt.smartindent = true
opt.termguicolors = true
opt.wrap = false
opt.cursorline = false
opt.hidden = false
opt.mouse = ""
-- search related
opt.ignorecase = true
opt.incsearch = true
opt.scrolloff = 999
vim.keymap.set("n", "<CR>", ":nohlsearch<CR>", { noremap = true, silent = true })
opt.undofile = true
opt.undodir = vim.fn.stdpath("config") .. "/undo"
-- status line
opt.statusline = " %f Line %l:%c %L lines"
-- netrw stuff
vim.g.netrw_banner = 0
vim.g.netrw_liststyle = 3
vim.g.netrw_sizestyle= "H"
vim.keymap.set("n", "t", "o<esc>", { noremap = true, silent = true })
vim.keymap.set("n", "T", "O<esc>", { noremap = true, silent = true })
vim.keymap.set("n", "df", "cc<esc>", { noremap = true, silent = true })
vim.keymap.set("i", "<C-F>", "<C-X><C-F>", { noremap = true })
-- quick window resizing
vim.keymap.set("n", "<C-H>", "<C-W><", { noremap = true, silent = true }) -- decrease width
vim.keymap.set("n", "<C-L>", "<C-W>>", { noremap = true, silent = true }) -- increase width
vim.keymap.set("n", "<C-K>", "<C-W>-", { noremap = true, silent = true }) -- decrease height
vim.keymap.set("n", "<C-J>", "<C-W>+", { noremap = true, silent = true }) -- increase height
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment