summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/nvim/init.vim21
1 files changed, 17 insertions, 4 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 3176eea..e143cd6 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -4,7 +4,7 @@
call plug#begin(stdpath('data') . '/plugged')
-Plug 'gruvbox-community/gruvbox'
+Plug 'doums/darcula'
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
@@ -26,10 +26,10 @@ nnoremap <SPACE> <Nop>
let mapleader=" "
set shiftwidth=2
-set nu rnu
+set number
set mouse=a
-colorscheme gruvbox
+colorscheme darcula
hi Normal guibg=NONE ctermbg=NONE
@@ -37,6 +37,13 @@ hi Normal guibg=NONE ctermbg=NONE
let g:NERDTreeShowHidden=1
+autocmd StdinReadPre * let s:std_in=1
+autocmd VimEnter * NERDTree | if argc() > 0 || exists('s:std_ine') | wincmd p | endif
+autocmd VimEnter * if argc() > 0 | silent NERDTreeFind | wincmd p | endif
+
+autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
+autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
+
map <C-b> <cmd>NERDTreeToggle<CR>
@@ -51,6 +58,7 @@ nnoremap <leader><leader> <cmd>Telescope buffers<CR>
" Keys
" "
+" buffer pane navigation
nnoremap <A-Left> <C-w><Left>
nnoremap <A-Up> <C-w><Up>
nnoremap <A-Right> <C-w><Right>
@@ -59,6 +67,11 @@ 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 <silent> <C-s> :w<CR>
+nnoremap <C-q> <cmd>q<CR>
+
+" save
+nnoremap <silent> <C-s> <cmd>w<CR>
+inoremap <silent> <C-s> <ESC><cmd>w<CR>