-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
116 lines (93 loc) · 2.91 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
115
116
set t_Co=256
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile
set history=50
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
" Softtabs, 2 spaces
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
" Numbers
set number
set numberwidth=5
" Get off my lawn
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" remap CoC binding
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif
syntax enable
augroup vimrcEx
autocmd!
" When editing a file, always jump to the last known cursor position.
" Don't do it for commit messages, when the position is invalid, or when
" inside an event handler (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" Automatically wrap at 72 characters and spell check git commit messages
autocmd FileType gitcommit setlocal textwidth=72
autocmd FileType gitcommit setlocal spell
autocmd BufNewFile,BufRead *.gradle setf groovy
autocmd FileType groovy setlocal tabstop=4
autocmd FileType groovy setlocal shiftwidth=4
" Allow stylesheets to autocomplete hyphenated words
autocmd FileType css,scss,sass setlocal iskeyword+=-
augroup END
set textwidth=120
set colorcolumn=+1
" Tab completion
" will insert tab at beginning of line,
" will use completion if not at beginning
set wildmode=list:longest,list:full
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <Tab> <c-r>=InsertTabWrapper()<cr>
inoremap <S-Tab> <c-n>
" configure lsc for dart
let g:lsc_auto_map = v:true
" configure syntastic syntax checking to check on open as well as save
let g:syntastic_check_on_wq = 0
let g:syntastic_check_on_open = 1
let g:syntastic_java_checkers = ['javac']
let g:syntastic_java_javac_config_file_enabled = 1
let g:airline_powerline_fonts = 1
if has("gui_running")
set mouse=a
set guioptions-=T
set guioptions-=r
set guioptions-=L
set guioptions-=M
set background=dark
colorscheme inkpot
set guifont=Monaco\ for\ Powerline:h13
set linespace=10
endif
let g:airline_theme='base16' " Airline Plugin Theme
map <silent> <C-k> :NERDTreeToggle<CR> " NERDTree
let g:NERDTreeDirArrows=1
" Local config
if filereadable($HOME . "/.vimrc.self")
source ~/.vimrc.self
endif