all repos — dotfiles @ cea0a45589c44b29d9a5b4dba3ee6a05a8ba14c2

linux dotfiles

nvim: move to lua config
Prithu Goswami pg@prithu.dev
Mon, 11 Jul 2022 23:11:26 +0530
commit

cea0a45589c44b29d9a5b4dba3ee6a05a8ba14c2

parent

7483b8971bafac942c55d8a328ad76c9b22cdf64

3 files changed, 36 insertions(+), 0 deletions(-)

jump to
A config/nvim/init.lua

@@ -0,0 +1,2 @@

+require 'options' +require 'keymaps'
A config/nvim/lua/keymaps.lua

@@ -0,0 +1,13 @@

+local k = vim.api.nvim_set_keymap +local options = { noremap = true, silent = true } + +vim.g.mapleader = ' ' +k('i', 'jk', '<esc>', options) +k('n', 'j', 'gj', options) +k('n', 'k', 'gk', options) +k('n', '<C-j>', '<C-W><C-J>', options) +k('n', '<C-k>', '<C-W><C-K>', options) +k('n', '<C-h>', '<C-W><C-H>', options) +k('n', '<C-l>', '<C-W><C-L>', options) +k('n', '<leader>m', ':nohlsearch<CR>', options) +k('n', '<leader>z', ':MaximizerToggle<CR>', options)
A config/nvim/lua/options.lua

@@ -0,0 +1,21 @@

+local o = vim.opt + +o.tabstop = 4 +o.softtabstop = 4 +o.shiftwidth = 4 +o.expandtab = true +o.smartindent = true +o.autoindent = true +o.undofile = true +--o.colorcolumn = '80' +o.mouse = 'a' +o.wildmenu = true +o.showmatch = true +o.incsearch = true +o.foldenable = true +o.foldmethod = 'indent' +-- open most folds by default +o.foldlevelstart = 10 +o.foldnestmax = 10 +o.number = true +o.backspace = 'indent,eol,start'