diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 32987ab..32a244b 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -21,23 +21,7 @@ require('lazy').setup({ { import = "plugins" } }) - https://github.com/fedepujol/move.nvim ]] -vim.keymap.set('n', '', ':move -2') -vim.keymap.set('n', '', ':move -2') -vim.keymap.set('n', '', ':move +1') -vim.keymap.set('n', '', ':move +1') - -vim.o.number = true -vim.o.relativenumber = true - -vim.opt.list = true -vim.opt.listchars = { tab = '→ ', trail = '·' } - -vim.opt.expandtab = true -vim.opt.tabstop = 4 -vim.opt.softtabstop = vim.opt.tabstop:get() -vim.opt.shiftwidth = 4 - -vim.opt.fillchars:append({ eob = ' ' }) +require("sets") +require("remaps") vim.notify("starting nvim 🏕️") - diff --git a/.config/nvim/lua/plugins/undotree.lua b/.config/nvim/lua/plugins/undotree.lua index fea3779..90aa1b9 100644 --- a/.config/nvim/lua/plugins/undotree.lua +++ b/.config/nvim/lua/plugins/undotree.lua @@ -2,7 +2,7 @@ return { "mbbill/undotree", keys = { { - "", + "", function() vim.cmd.UndotreeToggle(); vim.cmd.UndotreeFocus(); diff --git a/.config/nvim/lua/remaps.lua b/.config/nvim/lua/remaps.lua new file mode 100644 index 0000000..3c9fd6f --- /dev/null +++ b/.config/nvim/lua/remaps.lua @@ -0,0 +1,12 @@ +-- move selected lines and auto indent + +vim.keymap.set("v", "", ":m '>+1gv=gv") +vim.keymap.set("v", "", ":m '<-2gv=gv") + +-- zz centers the cursor + +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") + +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") diff --git a/.config/nvim/lua/sets.lua b/.config/nvim/lua/sets.lua new file mode 100644 index 0000000..0942864 --- /dev/null +++ b/.config/nvim/lua/sets.lua @@ -0,0 +1,46 @@ +-- line numbers + +vim.o.number = true +vim.o.relativenumber = true + +-- show hidden characters + +vim.opt.list = true +vim.opt.listchars = { tab = '→ ', trail = '·' } + +-- indentation + +vim.opt.expandtab = true +vim.opt.tabstop = 4 +vim.opt.softtabstop = vim.opt.tabstop:get() +vim.opt.shiftwidth = 4 + +vim.opt.smartindent = true + +-- line wrapping + +vim.opt.wrap = false + +-- undo history + +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.undodir = os.getenv("HOME") .. "/.local/state/nvim/undodir" +vim.opt.undofile = true + +vim.opt.updatetime = 50 + +-- end search when exiting + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +-- stuff + +vim.opt.fillchars:append({ eob = ' ' }) + +vim.opt.termguicolors = true + +vim.opt.scrolloff = 8 + +vim.opt.colorcolumn = "80"