-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexecutable_dot_vimrc
133 lines (117 loc) · 3.09 KB
/
executable_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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
"#######################
"
"#####################
set number
set list!
set listchars=tab:»·,trail:·
"Folding is bad and it should feel bad, and also be disabled
set nofoldenable
"Fix Delay on Esc
set timeoutlen=1000 ttimeoutlen=10
"Highlighting
set cursorline
hi CursorLine term=bold cterm=bold
hi CursorLineNR ctermbg=cyan
"Because I forget sudo frequently
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
"backspace should behave like backspace
:set backspace=indent,eol,start
"remamp esc to jj and jk
imap jj <Esc>
imap jk <Esc>
"########
"Plugins#
"#######
"Start Vim-plug
call plug#begin()
"Plugins
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'ourigen/skyline.vim'
Plug 'chase/vim-ansible-yaml'
Plug 'plasticboy/vim-markdown'
Plug 'ntpeters/vim-better-whitespace'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'airblade/vim-gitgutter'
Plug 'stephpy/vim-yaml'
Plug 'jamessan/vim-gnupg'
Plug 'robertbasic/vim-hugo-helper'
Plug 'neovim/nvim-lspconfig'
Plug 'luukvbaal/nnn.nvim'
Plug 'ms-jpq/coq_nvim', {'branch': 'coq'}
Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'}
Plug 'williamboman/nvim-lsp-installer'
call plug#end()
set tabstop=4 shiftwidth=4
let mapleader = "\<Space>"
"###########
"Navigation#
"##########
" Use ctrl-[hjkl] to select the active split
nmap <silent> <c-k> :wincmd k<CR>
nmap <silent> <c-j> :wincmd j<CR>
nmap <silent> <c-h> :wincmd h<CR>
nmap <silent> <c-l> :wincmd l<CR>
"Buffers, prefix is leader
" l : list buffers
" b f g : go back/forward/last-used
" 1 2 3 : go to buffer 1/2/3 etc
nmap <Leader>l :Buffers<CR>
nnoremap <Leader>b :bp<CR>
nnoremap <Leader>x :bd<CR>
nnoremap <Leader>f :bn<CR>
nnoremap <Leader>g :e#<CR>
nnoremap <Leader>1 :1b<CR>
nnoremap <Leader>2 :2b<CR>
nnoremap <Leader>3 :3b<CR>
nnoremap <Leader>4 :4b<CR>
nnoremap <Leader>5 :5b<CR>
nnoremap <Leader>6 :6b<CR>
nnoremap <Leader>7 :7b<CR>
nnoremap <Leader>8 :8b<CR>
nnoremap <Leader>9 :9b<CR>
nnoremap <Leader>0 :10b<CR>
"#################
"#Plugin Settings#
"#################
"Skyline
let g:skyline_fugitive = 1
"Fugitive
set statusline=%{fugitive#statusline()}
"Ansible
au BufRead,BufNewFile */ansible/*.yml set filetype=ansible
au BufRead,BufNewFile */ansible/*.yaml set filetype=ansible
let g:ansible_unindent_after_newline = 1
" fzf.vim
let g:fzf_files_options =
\ '--preview-window top:60% ' .
\ '--preview "(bat --color "always" {} || cat {}) 2> /dev/null | head -'
\ . &lines . '"'
nmap <Leader>; :Files<CR>
nmap <Leader>' :Rg<CR>
"Relative Numbering
function! NumberToggle()
if(&relativenumber == 1)
set nornu
set number
else
set rnu
endif
endfunc
" Toggle between normal and relative numbering.
nnoremap <leader>r :call NumberToggle()<cr>
au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md set ft=markdown
" COQ
map <F3> :COQnow<CR>
" LSP Config
sign define LspDiagnosticsSignError text=🔴
sign define LspDiagnosticsSignWarning text=🟠
sign define LspDiagnosticsSignInformation text=🔵
sign define LspDiagnosticsSignHint text=🟢
luafile ~/.vim/lsp_config.lua
" nnn-vim
map <F2> :NnnExplorer<CR>
lua << EOF
require("nnn").setup()
EOF