dotfiles/nvim/init.vim

73 lines
1.7 KiB
VimL
Raw Normal View History

2020-08-22 16:04:56 +00:00
let mapleader=" "
" Basic stuff
set mouse=a
set nocompatible
set nohlsearch
filetype plugin on
syntax on
set encoding=utf-8
set number
set termguicolors
2020-09-08 13:01:22 +00:00
set splitbelow splitright
" restore cursor to the last position after reopening a file
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ | endif
2020-08-22 16:04:56 +00:00
" Enable spell checking, s for spell check
map <leader>se :setlocal spell! spelllang=en<CR>
map <leader>sr :setlocal spell! spelllang=ro<CR>
" ###
" # Plugins
" ###
call plug#begin('~/.local/share/nvim/plugged')
2020-09-15 15:39:41 +00:00
" REMINDER - on a new system install go for hexokinase (color preview)
2020-08-22 16:04:56 +00:00
Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' }
2020-09-15 15:39:41 +00:00
Plug 'vimwiki/vimwiki'
2020-08-22 16:04:56 +00:00
call plug#end()
" hexokinase
let g:Hexokinase_refreshEvents = ['InsertLeave']
let g:Hexokinase_highlighters = ['backgroundfull']
autocmd VimEnter * HexokinaseTurnOn
" ###
" # Key Remapping
" ###
2020-09-15 15:39:41 +00:00
" Reload this config file
2020-08-22 16:04:56 +00:00
map <C-s> :source ~/.config/nvim/init.vim<CR>
2020-09-08 13:01:22 +00:00
nnoremap <leader>e :Ex<CR>
" Easier Write and Quit aliases
nnoremap <leader>q :q<CR>
nnoremap <leader>Q :wq<CR>
nnoremap <leader>w :w<CR>
" Split navigation with leader key
nnoremap <leader>h <C-w>h
nnoremap <leader>j <C-w>j
nnoremap <leader>k <C-w>k
nnoremap <leader>l <C-w>l
" Make adjusing split sizes a bit more friendly
noremap <silent> <C-Left> :vertical resize +3<CR>
noremap <silent> <C-Right> :vertical resize -3<CR>
noremap <silent> <C-Up> :resize +3<CR>
noremap <silent> <C-Down> :resize -3<CR>
" New splits
nnoremap <leader>sv :Vex<CR>
nnoremap <leader>sh :Sex<CR>
nnoremap <leader>t :24sp<CR>:term<CR>:startinsert<CR>
" exit insert mode in terminal easier
tnoremap <C-\> <C-\><C-N>