summaryrefslogtreecommitdiff
path: root/.config/nvim/init.vim
blob: e143cd6d9271ebc253e5a17cbfa44d7ab510c737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
" "
" Plugins
" "

call plug#begin(stdpath('data') . '/plugged')

Plug 'doums/darcula'

Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
Plug 'Xuyuanp/nerdtree-git-plugin'

Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'

Plug 'airblade/vim-gitgutter'

call plug#end()


" "
" Config
" "

nnoremap <SPACE> <Nop>
let mapleader=" "

set shiftwidth=2
set number
set mouse=a

colorscheme darcula
hi Normal guibg=NONE ctermbg=NONE


" Nerdtree

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>


" Telescope
 
nnoremap <leader>ff <cmd>Telescope find_files<CR>
nnoremap <leader>fg <cmd>Telescope live_grep<CR>
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>
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>