~damien/dotfiles

ref: 049aeef81ba7ae64df3f82b06a6690f8e9ad97ed dotfiles/vim/.vimrc -rw-r--r-- 1.6 KiB
049aeef8Damien Radtke Small vim improvements 4 months ago
                                                                                
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
call plug#begin()
Plug 'arrufat/vala.vim'
Plug 'benmills/vimux'
Plug 'dradtke/vim-dap'
Plug 'hashivim/vim-terraform'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'rust-lang/rust.vim'
Plug 'scrooloose/nerdtree'
Plug 'thomd/vim-wasabi-colorscheme'
Plug 'mhartington/oceanic-next'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-sensible'
Plug 'jvirtanen/vim-hcl'
Plug 'ziglang/zig.vim'
if has('nvim')
	Plug 'nvim-lua/popup.nvim'
	Plug 'nvim-lua/plenary.nvim'
endif
if has('nvim-0.5')
	Plug 'neovim/nvim-lspconfig'
	Plug 'nvim-telescope/telescope.nvim'
	Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
	Plug 'jlanzarotta/bufexplorer'
endif
call plug#end()

set hidden
set modeline
set nu
set completeopt=menuone,noinsert,noselect
set tabstop=4 shiftwidth=4
nmap <Leader>ff :FZF<cr>
nmap <Leader>nt :NERDTreeToggle<cr>
nmap <Leader>nf :NERDTreeFind<cr>
nmap <Leader>nh :set nohls<cr>

au FileType go setlocal noexpandtab tabstop=4 shiftwidth=4
au FileType go call s:set_make_go()
au FileType go command! Imports call s:go_imports()
au FileType html setlocal expandtab tabstop=2 shiftwidth=2
au FileType json setlocal expandtab tabstop=2 shiftwidth=2
au FileType javascript setlocal expandtab tabstop=4 shiftwidth=4
au BufNewFile,BufRead *.xaml set filetype=xml

if has('nvim-0.5')
	silent! colorscheme OceanicNext
else
	silent! colorscheme wasabi256
endif
highlight! link NonText NONE

function! s:set_make_go() abort
	let l:dir = expand('%:p:h')
	execute 'setlocal makeprg=go\ build\ '.l:dir
endfunction

function! s:go_imports() abort
	execute '!goimports -w '.expand('%')
endfunction