aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/.config/nvim/init.vim
blob: 3e4ca86846d78068e68c192d7f784f5bcbd7e100 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
call plug#begin('~/.local/share/nvim/plugged')
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-fzy-native.nvim'

Plug 'editorconfig/editorconfig-vim'

Plug 'tpope/vim-sensible'
Plug 'tpope/vim-vinegar'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-surround'

"Plug 'morhetz/gruvbox'
Plug 'gruvbox-community/gruvbox'

Plug 'itchyny/lightline.vim'

Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align'

Plug 'stsewd/fzf-checkout.vim'

Plug 'kien/rainbow_parentheses.vim'

Plug 'liuchengxu/vim-which-key'

Plug 'ctrlpvim/ctrlp.vim'
Plug 'mileszs/ack.vim'

Plug 'terryma/vim-multiple-cursors'

Plug 'dense-analysis/ale'
Plug 'lyuts/vim-rtags'

Plug 'airblade/vim-gitgutter'

Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'preservim/nerdcommenter'


Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/completion-nvim'

call plug#end()

lua require'pstr.settings'
lua require'pstr.lsp'
lua require'pstr.telescope'

" basics
syntax on

"esc
imap jk <Esc>

"nerdtree
let NERDTreeMinimalUI = 1

"ctlp and ack
let g:ctrlp_user_command = ['.git', 'git --git-dir=%s/.git ls-files -co --exclude-standard']
let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_use_caching = 0
if executable('rg')
  let g:ackprg = 'rg --vimgrep'
elseif executable('ag')
  let g:ackprg = 'ag --vimgrep'
endif

"leader
let mapleader = " "
"noremap <silent> <Leader> :WhichKey '<Space>'<CR>
"set timeoutlen=500


"keys
map <leader>ff :Files<CR>
map <leader>fp :CtrlP<CR>
nnoremap <leader>gc :GCheckout<CR>

" Disable Arrow keys in Normal mode
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>

" Disable Arrow keys in Insert mode
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>

map <leader>wh :wincmd h<CR>
map <leader>wj :wincmd j<CR>
map <leader>wk :wincmd k<CR>
map <leader>wl :wincmd l<CR>
nnoremap <Leader>pt :NERDTreeToggle<Enter>
nnoremap <silent> <Leader>pv :NERDTreeFind<Enter>

fun! TrimWhitespace()
    let l:save = winsaveview()
    keeppatterns %s/\s\+$//e
    call winrestview(l:save)
endfun

augroup PSTR
    autocmd!
    autocmd BufWritePre * :call TrimWhitespace()
augroup END