74 lines
2 KiB
VimL
74 lines
2 KiB
VimL
" Packer plugins
|
|
lua require('plugins')
|
|
|
|
" Gruvbox Theme
|
|
if has('termguicolors')
|
|
set termguicolors
|
|
endif
|
|
" For dark version.
|
|
set background=dark
|
|
" Set contrast.
|
|
" This configuration option should be placed before `colorscheme gruvbox-material`.
|
|
" Available values: 'hard', 'medium'(default), 'soft'
|
|
let g:gruvbox_material_background = 'medium'
|
|
" For better performance
|
|
let g:gruvbox_material_better_performance = 1
|
|
colorscheme gruvbox-material
|
|
|
|
" Miscellaneous boilerplate
|
|
set nocompatible " Disable vi compatibility
|
|
set ignorecase
|
|
set cc=80 " 80 characters
|
|
set noswapfile
|
|
set backupdir=~/.cache/nvim
|
|
set cursorline " Highlight current line
|
|
set mouse=a " Mouse
|
|
|
|
" Default indentation
|
|
set softtabstop=4
|
|
set tabstop=4
|
|
set shiftwidth=4
|
|
set expandtab
|
|
set autoindent
|
|
|
|
" Syntax highlighting
|
|
set syntax=on
|
|
|
|
" Show line numbers on non-toolbar buffers
|
|
fun! ShowNumberIfNecessary()
|
|
if &ft =~ 'neo-tree|toggleterm'
|
|
return
|
|
endif
|
|
setlocal nu
|
|
endfun
|
|
autocmd BufEnter * call ShowNumberIfNecessary()
|
|
autocmd TermOpen,TermEnter term://* setlocal nonumber
|
|
|
|
" Terminal remapping
|
|
lua << EOF
|
|
function _G.set_terminal_keymaps()
|
|
local opts = {buffer = 0}
|
|
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
|
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
|
|
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
|
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
|
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
|
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
|
end
|
|
EOF
|
|
autocmd TermOpen term://* lua set_terminal_keymaps()
|
|
|
|
" Focus moving remaps
|
|
lua << EOF
|
|
function _G.set_focus_keymaps()
|
|
vim.keymap.set('n', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
|
vim.keymap.set('n', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
|
vim.keymap.set('n', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
|
vim.keymap.set('n', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
|
end
|
|
EOF
|
|
autocmd BufEnter * lua set_focus_keymaps()
|
|
|
|
" Startup commands
|
|
autocmd UIEnter * Neotree
|