forked from dotphiles/dotphiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
82 lines (69 loc) · 2.36 KB
/
vimrc
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
call plug#begin()
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'sebdah/vim-delve'
Plug 'morhetz/gruvbox'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'tpope/vim-fugitive'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'airblade/vim-gitgutter'
Plug 'jreybert/vimagit'
Plug 'scrooloose/nerdtree'
Plug 'vim-airline/vim-airline'
call plug#end()
" gruvbox conf
autocmd vimenter * ++nested colorscheme gruvbox
set background=dark
" General settings
set incsearch
set number
set confirm " confirm instead of requiring !
set nobackup noswapfile
set ignorecase smartcase smartindent smarttab
set showmatch incsearch
set hidden " allow switch between buffers without saving
set wildmenu " better command-line completion
inoremap jk <ESC>
vnoremap jk <ESC>
let mapleader = "\<SPACE>"
" LSP settings
let g:completor_filetype_map = {}
let g:completor_filetype_map.go = {'ft': 'lsp', 'cmd': 'gopls -remote=auto'}
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
" Gitgutter settings
let g:gitgutter_override_sign_column_highlight = 1
" Git key mappings
nmap <Leader>gn <Plug>GitGutterNextHunk " git next
nmap <Leader>gp <Plug>GitGutterPrevHunk " git previous
nmap <Leader>gm :Magit<CR>
" FZF settings
" Let The :Files command show all files in the repo (including dotfiles)
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --glob "!.git/*"'
" Bind "//" to a fzf-powered buffer search
nmap // :BLines!<CR>
" Bind "??" to a fzf-powered project search
nmap ?? :Rg!<CR>
" Bind "<leader>p" to a fzf-powered filename search
nmap <leader>p :Files!<CR>
" Bind "cc" to a fzf-powered command search
nmap cc :Commands!<CR>
" NERDTree
let NERDTreeShowHidden=1
function! ToggleNERDTree()
NERDTreeToggle
" Set NERDTree instances to be mirrored
silent NERDTreeMirror
endfunction
" Bind "<leader>n" to toggle NERDTree
nmap <leader>n :call ToggleNERDTree()<CR>
" term settings
noremap <leader>g :tab term ++close lazygit<CR>
" term variants of the tab navigation bindings from above to make the
" interactive command line tools easier to work with
tmap <C-h> <C-w>:tabp<CR>
tmap <C-l> <C-w>:tabn<CR>