Skip to content

Instantly share code, notes, and snippets.

@diogotito
Last active July 16, 2024 11:31
Show Gist options
  • Save diogotito/70fa75598b7e71d835e12bbe8b77283b to your computer and use it in GitHub Desktop.
Save diogotito/70fa75598b7e71d835e12bbe8b77283b to your computer and use it in GitHub Desktop.
Minimal Neovim init.lua
--[[
I'm actually interested in moving to Lazyvim if I am ever to adopt Neovim as my main development editor.
This is just for some light editing sesions in the terminal
--]]
-- Don't load Vim plugins installed with pacman
vim.opt.rtp:remove('/usr/share/vim/vimfiles')
-- Gosh I can't unlearn this habit!
local cursed_esc = 'jk'
vim.keymap.set('i', cursed_esc, [[<Esc>]])
vim.keymap.set('t', cursed_esc, [[<C-\><C-N>]])
-- Personal whitespace settings
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
-- Buffer management
vim.keymap.set('n', '<Tab>', '<C-6>')
vim.keymap.set('n', '<Leader>l', vim.cmd.ls)
vim.keymap.set('n', '<Leader>h', ':<C-u>vertical belowright help ')
vim.keymap.set({'i', 'n'}, '<C-s>', vim.cmd.write)
-- Terminals
vim.keymap.set('n', '<Leader>t', '<Cmd>vertical belowright split|terminal<CR>')
vim.api.nvim_create_autocmd({'TermOpen'}, {
pattern = '*',
callback = function() vim.cmd.startinsert() end
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment