-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
187 lines (155 loc) · 4.26 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
set nocompatible
syntax enable
set synmaxcol=9999
syntax sync minlines=256
filetype plugin indent on
set laststatus=2
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set noerrorbells
set backspace=indent,eol,start
set wrap linebreak
" increase max memory to show syntax highlighting for large files
set maxmempattern=30000
set re=1
set incsearch
set hlsearch
set mouse=a
set noswapfile
set smartcase
set showcmd
set cursorline
set number
set clipboard=unnamed
set lazyredraw
set redrawtime=4000
set wildmenu
set autoindent
set nocursorcolumn
set nocursorline
set norelativenumber
set updatetime=300
set ttyfast
set shell=/bin/zsh
" Enable omni completion and enable more characters to be available within
" autocomplete by appending to the 'iskeyword' variable.
set iskeyword+=-
" Persistent Undo
if has('persistent_undo')
set undofile
set undodir=~/.cache/vim
endif
" VimPlug
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
autocmd VimEnter * PlugInstall --sync | source ~/.vimrc
endif
call plug#begin('~/.vim/plugged')
" Kitty Interop
Plug 'knubie/vim-kitty-navigator', {'do': 'cp ./*.py ~/.config/kitty/'}
" Utilities
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'ryanoasis/vim-devicons'
Plug 'wellle/context.vim'
Plug 'tpope/vim-fugitive'
Plug 'vitalk/vim-simple-todo'
Plug 'rhysd/conflict-marker.vim'
" Fuzzy Finder
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Lightline
Plug 'itchyny/lightline.vim'
Plug 'josa42/vim-lightline-coc'
" Colorscheme
Plug 'rose-pine/vim'
call plug#end()
" ----------------------------------
" Lightline Settings
" Register the components:
let g:lightline = {}
let g:lightline.component_expand = {
\ 'linter_warnings': 'lightline#coc#warnings',
\ 'linter_errors': 'lightline#coc#errors',
\ 'linter_info': 'lightline#coc#info',
\ 'linter_hints': 'lightline#coc#hints',
\ 'linter_ok': 'lightline#coc#ok',
\ 'status': 'lightline#coc#status',
\ }
" Set color to the components:
let g:lightline.component_type = {
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_info': 'info',
\ 'linter_hints': 'hints',
\ 'linter_ok': 'left',
\ }
" Add the components to the lightline:
let g:lightline.active = {
\ 'left': [ [ 'coc_info', 'coc_hints', 'coc_errors', 'coc_warnings', 'coc_ok' ],
\ [ 'coc_status' ],
\ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ }
" Git Fugitive - lightline integration
let g:lightline.component_function = {
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead',
\ 'coc_status': 'coc#status',
\ }
\ }
" register compoments:
call lightline#coc#register()
" ----------------------------------
" ----------------------------------
" Colorscheme Settings
let g:disable_float_bg = 1
let g:lightline.colorscheme = 'rosepine'
colorscheme rosepine
set background=dark
" transparent background
hi Normal guibg=NONE ctermbg=NONE
" NERDTree Open/Close
map <silent> <Leader>t :NERDTreeToggle<CR>
" Show hidden files
let NERDTreeShowHidden=1
" Remap escape key
inoremap <S-Tab> <Esc>
onoremap <S-Tab> <Esc>
" NOH on Escape
nnoremap <silent> <Esc> :noh<CR>
" ; same as :
nnoremap ; :
" Autocommand
augroup vimrc_autocmd
autocmd!
" Markdown tab settings
autocmd FileType markdown setlocal shiftwidth=2 softtabstop=2 expandtab
" Set dockerfile syntax
autocmd BufNewFile,BufRead Dockerfile* set syntax=dockerfile
augroup END
" JAVA CONFIG
au FileType java set colorcolumn=100
" RUST CONFIG
au FileType rust set colorcolumn=100
" Fugitive Conflict Resolution
nnoremap <leader>gd :Gvdiff<CR>
" Vim Context
let g:context_enabled = 1
" Fzf Bindings
nnoremap <c-p> :GFiles<CR>
map <c-f> :Rg<CR>
" Move lines up/down
nnoremap <A-up> :m-2<CR>
nnoremap <A-Down> :m+<CR>
inoremap <A-Up> <Esc>:m-2<CR>
inoremap <A-Down> <Esc>:m+<CR>
" ------------------------------------------------"
" Copilot
let g:copilot_enabled = v:false
" ------------------------------------------------"
" Simple Todo
let g:simple_todo_list_symbol = '-'