summaryrefslogtreecommitdiff
path: root/.config/nvim/config
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/config')
-rw-r--r--.config/nvim/config/config.vim33
-rw-r--r--.config/nvim/config/keys.vim20
2 files changed, 53 insertions, 0 deletions
diff --git a/.config/nvim/config/config.vim b/.config/nvim/config/config.vim
new file mode 100644
index 0000000..0f2b65e
--- /dev/null
+++ b/.config/nvim/config/config.vim
@@ -0,0 +1,33 @@
+set mouse=a
+set splitright
+
+set updatetime=250
+
+" tabs, spaces
+set shiftwidth=2
+set tabstop=2
+set expandtab
+
+set list
+set listchars=tab:\ \ ,trail:-
+
+" ruler
+set relativenumber number
+augroup numbertoggle
+ autocmd!
+ autocmd BufEnter,WinEnter * if &nu && mode() != 'i' | set relativenumber | endif
+ autocmd BufLeave,WinLeave * if &nu | set norelativenumber | endif
+augroup END
+
+" colors
+colorscheme darcula
+set termguicolors
+highlight Normal guibg=NONE ctermbg=NONE
+
+" diff
+if &diff
+ autocmd BufEnter * if winnr('$') == 1 | quit | endif
+endif
+
+" pdf
+autocmd BufEnter *.pdf split | exe expandcmd("terminal firefox <afile>:p") | quit
diff --git a/.config/nvim/config/keys.vim b/.config/nvim/config/keys.vim
new file mode 100644
index 0000000..bfb45e9
--- /dev/null
+++ b/.config/nvim/config/keys.vim
@@ -0,0 +1,20 @@
+" leader
+nnoremap <SPACE> <Nop>
+let mapleader=" "
+
+" buffer pane navigation
+nnoremap <A-Left> <C-w><Left>
+nnoremap <A-Up> <C-w><Up>
+nnoremap <A-Right> <C-w><Right>
+nnoremap <A-Down> <C-w><Down>
+
+nnoremap <C-Left> <cmd>tabprevious<CR>
+nnoremap <C-Right> <cmd>tabnext<CR>
+
+" esc / quit
+map <ESC><C-c> <CR>
+nnoremap <C-q> <cmd>q<CR>
+
+" save
+nnoremap <silent> <C-s> <cmd>w<CR>
+inoremap <silent> <C-s> <ESC><cmd>w<CR>