-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot-vimrc
112 lines (89 loc) · 2.22 KB
/
dot-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
" Section: General Settings {{{
set nocompatible
set nowrap
set nohlsearch
set backspace=indent,eol,start
set nobackup
set showmatch
syntax on
set ruler
set showcmd
set modelines=1
set showtabline=2
set ff=unix
set ffs=unix,dos
set sw=2 sts=2 ts=2 et
set bg=dark
set encoding=utf-8
set colorcolumn=80
set updatetime=100
set sessionoptions+=tabpages,globals
packadd! matchit
" }}}
" Section: Autocmd {{{
if has("autocmd")
filetype plugin indent on
augroup vimrcEx
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END
au BufRead,BufNewFile *.go set filetype=go
au BufRead,BufNewFile *.tf set filetype=terraform
au BufRead,BufNewFile *.hcl set filetype=terraform
autocmd FileType python set sw=4 sts=4 ts=4 et
autocmd FileType go set sw=8 sts=8 ts=8 noet
autocmd FileType yaml set sw=2 sts=2 ts=2 et
autocmd FileType yaml setlocal indentkeys-=0#
else
set autoindent
endif
let g:cue_fmt_on_save=0
let g:slime_target = "tmux"
let g:slime_no_mappings = 1
let g:ale_completion_enabled = 1
let g:ale_set_quickfix = 1
let g:ale_lint_on_text_changed = 'never'
set omnifunc=ale#completion#OmniFunc
set number
" }}}
" Section: Folding {{{
set foldenable
set foldlevelstart=99
set foldnestmax=10
set foldmethod=indent
" }}}
" Section: Shortcuts {{{
let mapleader = ","
let maplocalleader = "\\"
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
" Normal Mode
nmap <leader>n :set invnumber<CR>
nnoremap <space> za
nmap <leader>T :enew<CR>
nmap <leader>l :bnext<CR>
nmap <leader>h :bprevious<CR>
nmap <leader>bq :bp <BAR> bd #<CR>
nmap <leader>bl :ls<CR>
nmap <leader>s <Plug>SlimeMotionSend
nmap <leader>ss <Plug>SlimeLineSend
nmap <leader>d :NERDTreeToggle<CR>
nmap <leader>g :vertical Git<CR>
nmap <leader>p :CtrlP<CR>
nmap <leader>ad <Plug>(ale_go_to_definition)
autocmd FileType markdown nnoremap <buffer> <leader>r :MarkdownRunner<CR>
autocmd FileType markdown nnoremap <buffer> <leader>R :MarkdownRunnerInsert<CR>
" Insert Mode
inoremap jj <esc>
inoremap <Up> <nop>
inoremap <Down> <nop>
inoremap <Left> <nop>
inoremap <Right> <nop>
" Visual Mode
xmap <leader>s <Plug>SlimeRegionSend
" }}}
" vim:foldmethod=marker:foldlevel=0