Skip to content

Instantly share code, notes, and snippets.

@vaibhav-kaushal
Created December 6, 2023 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vaibhav-kaushal/6e180d3b35c5f2b1c575aba9f559b1ce to your computer and use it in GitHub Desktop.
Save vaibhav-kaushal/6e180d3b35c5f2b1c575aba9f559b1ce to your computer and use it in GitHub Desktop.
lunarvim
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
-- better window management
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', {silent = true})
vim.api.nvim_set_keymap('n', '<C-i>', '<C-w>i', {silent = true})
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', {silent = true})
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', {silent = true})
-- better indenting
vim.api.nvim_set_keymap('v', '<', '<gv', {noremap = true, silent = true})
vim.api.nvim_set_keymap('v', '>', '>gv', {noremap = true, silent = true})
-- I hate escape
-- vim.api.nvim_set_keymap('i', 'jk', '<ESC>', {noremap = true, silent = true})
-- vim.api.nvim_set_keymap('i', 'kj', '<ESC>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('i', 'jj', '<ESC>', {noremap = true, silent = true})
-- To dismiss the autocomplete menu in edit mode (it's an irritation)
vim.api.nvim_set_keymap('i', ',,', '<C-e>', {noremap = true, silent = true})
-- Block cursor in edit mode
vim.opt.guicursor = "i:block"
-- Tab switch buffer
vim.api.nvim_set_keymap('n', '<TAB>', ':bnext<CR>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<S-TAB>', ':bprevious<CR>', {noremap = true, silent = true})
-- NvimTree
vim.api.nvim_set_keymap('n', '<leader>nr', ':NvimTreeResize<space>40<CR>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>nR', ':NvimTreeResize', {noremap = true, silent = true})
-- Go LSP Config
require('lspconfig').gopls.setup {
cmd = {"gopls", "--remote=auto"},
on_new_config = function(new_config, new_root_dir)
new_config.cmd_env = {
GOFLAGS = "-mod=vendor"
}
end,
}
-- If you enable this, the top shortcut of 'jj' on insert mode won't work because you literally can't
-- press 'j' two times in a row within 1 milliseconds!
-- vim.o.timeoutlen = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment