-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
156 lines (119 loc) · 3.16 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
let mapleader = ' '
let maplocalleader = ','
noremap ; :
" Copy to system clipboard
noremap Y "+y
" Help
noremap <C-]> K
cabbrev vh vert help
" Edit configuration
noremap <leader>rc <cmd>edit $MYVIMRC<cr>
" Sessions
noremap <leader>ss <cmd>mksession! .session.vim<cr>
noremap <leader>sr <cmd>source .session.vim<cr>
" Motions
noremap H ^
noremap L g_
noremap gh ^
noremap gl g_
" Arrow keys move window view, not cursor
noremap <up> <C-y>
noremap <down> <C-e>
" Buffer and window switching
noremap <s-left> <cmd>bprev<cr>
noremap <s-right> <cmd>bnext<cr>
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" Repeat search
noremap <a-,> ,
noremap <a-.> ;
noremap ≤ ,
noremap ≥ ;
noremap N Nzz
noremap n nzz
" EDITING
set spelloptions=camel
""" Insert Mode Completion
set complete-=t " No tag completion
set completeopt=menuone,noinsert,noselect
set shortmess+=c " no ins-completion-menu messages
""" Command Line Completion
set wildignorecase
set wildmenu
set wildoptions+=fuzzy
""" Indentation. See `:h editorconfig` and `../.editorconfig`
set autoindent
set smartindent
" MOVING AROUND
""" Buffer Navigation
set mouse=a
set scrolloff=5
set sidescrolloff=5
set virtualedit=block
set linebreak
set nowrap
set whichwrap=<,>,[,] " Left/Right arrows keys can move to next line
""" Search
set hlsearch
set incsearch
set ignorecase
set smartcase
" APPEARANCE
syntax enable
set shortmess+=I " no intro message
set colorcolumn=100
""" Conceal & Whitespace
set conceallevel=2
set listchars=eol:~,extends:»,precedes:«,multispace:·,tab:├─,trail:•,nbsp:_
set listchars+=leadmultispace:▹\ \ \ " TODO: set depending on indentation level
""" Folds
set foldlevel=9
" set foldmethod=indent " If not using tree-sitter
set fillchars=fold:\ ,eob:\ , " Hide fillchars
set foldtext=getline(v:foldstart).'\ …\ '.trim(getline(v:foldend))
""" Status Column (Gutter)
set number
set foldcolumn=1
set signcolumn=number
""" Status Line
set ruler
set noshowmode
set showcmd
" FILES & BUFFERS
""" Files
set autoread
set confirm " ask to save stuff
set fileencoding=utf-8 " encoding written to file
set noswapfile
""" Buffers
set hidden " hide buffers instead of closing them
set splitbelow
set splitright
""" Persistent Undo
set undodir="$HOME/.local/share/nvim/undo"
set undofile
set undolevels=100 " How many undos
set undoreload=1000 " number of lines to save for undo
set updatetime=500
""" Netrw
let g:netrw_banner = 0 " no banner
let g:netrw_dirhistmax = 0 " no history
let g:netrw_liststyle = 3 " tree style listing
" DISABLE STANDARD PLUGINS (:help standard-plugin-list)
let g:loaded_2html_plugin = 1
let g:loaded_gzip = 1
" let g:loaded_man = 1
" let g:loaded_matchit = 1
" let g:loaded_matchparen = 1
" let g:loaded_netrwPlugin = 1
let g:loaded_remote_plugins = 1
let g:loaded_spellfile_plugin = 1
" let g:loaded_tarPlugin = 1
" let g:loaded_tutor_mode_plugin = 1
" let g:loaded_zipPlugin = 1
let g:omni_sql_default_compl_type = 'syntax' " github.com/neovim/neovim/issues/14433
" FILETYPE SPECIFIC OPTIONS
autocmd FileType Lua setlocal keywordprg=:help
autocmd FileType yaml setlocal lisp