-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
116 lines (89 loc) · 2.58 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
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
112
113
114
syntax on
filetype plugin indent on
set hidden
set nohlsearch
set incsearch
set ignorecase
set smartcase
set nowrap
set number
" very useful for go files when they are changed by go fmt
set autoread
set dir=~/tmp/
set ts=4
set shiftwidth=4
set et!
set visualbell
set autoindent
set ttyfast
set showmatch
set backspace=2
set wildmenu
set wildignore=*.o,*.class,*.so*,*.swp,*.pyc,*.pyo,core
set wildmode=longest:full
let mapleader=","
map ,, gqap
set textwidth=120
set cursorline
" always have a statusline
set laststatus=2
set statusline=%F%m%r%h%w\ (%{&ff}){%y}[%l,%v][%p%%]\ %{strftime(\"%d.%m.%Y\ -\ %H:%M\")}
" gradle build files
au BufRead,BufNewFile *.gradle setlocal filetype=groovy
" Jenkinsfile
au BufRead,BufNewFile Jenkinsfile setlocal filetype=groovy
" go html templates
au BufRead,BufNewFile *.gohtml setlocal filetype=html
" asciidoc files
au BufRead,BufNewFile *.adoc setlocal filetype=asciidoc
" some xml stuff
command! -nargs=0 FormatXml :silent 1,$!xmllint --format --recover - 2>/dev/null
command! -nargs=0 FormatJson :silent 1,$!jq '.' 2>/dev/null
" toggle outline
map <F8> :TagbarToggle<CR>
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
call plug#begin('~/.vim/plugged')
Plug 'majutsushi/tagbar'
Plug 'ervandew/supertab'
Plug 'tpope/vim-fugitive'
Plug 'vim-scripts/matchit.zip'
Plug 'vim-airline/vim-airline'
Plug 'itspriddle/vim-shellcheck'
Plug 'vim-airline/vim-airline-themes'
Plug 'mtth/scratch.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'fs111/vim-ripgrep'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'junegunn/fzf.vim'
Plug 'junegunn/fzf'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'NLKNguyen/papercolor-theme'
call plug#end()
" this must be done before setting the color theme
set termguicolors
if has('mac')
" uctags understand go
let g:tagbar_ctags_bin = '/opt/local/bin/uctags'
endif
set background=dark
colo PaperColor
let g:airline_theme = 'papercolor'
" scratch file location
let g:scratch_persistence_file='~/tmp/.vimscratch'
map <leader>lf :LspDocumentFormat<CR>
map <leader>ld :LspDefinition<CR>
map <leader>lr :LspRename<CR>
map <leader>loi :LspCodeActionSync source.organizeImports<CR>
map <leader>lh :LspHover<CR>