-
Notifications
You must be signed in to change notification settings - Fork 7
/
.vimrc
158 lines (133 loc) · 4.06 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
" --General ---
" Space is king
let mapleader = " "
let maplocalleader = " "
set exrc
set shortmess+=W
set termguicolors
syntax on
set backspace=indent,eol,start
set nocompatible
set nohlsearch
set ruler
set number
set nowrap
set showcmd
set incsearch
set noswapfile
set autoread
set ignorecase
set smartcase
set noerrorbells
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set cursorline
set backupcopy=yes
set relativenumber
set signcolumn=yes
set scrolloff=8
set hidden
set splitright
hi LinrNr term=NONE
filetype plugin indent on
"--- Load plugins
" source ~/.vim/rcfiles/plugins.vim
" Pinkmare by me btw
colorscheme pinkmare
hi! MatchParen cterm=NONE,bold gui=NONE,bold guibg=#87c095 guifg=NONE
"--- Source statusline
source ~/.vim/rcfiles/statusline.vim
"--- Source tabline
source ~/.vim/rcfiles/tabline.vim
"--- Source nvim stuff
source ~/.vim/rcfiles/nvim.vim
" -- Dev icons for nerdtree
set encoding=UTF-8
" -- Open nerdtree on leader t
nmap <silent> <leader>t :NERDTreeTabsToggle<CR>
let NERDTreeShowHidden=1
let g:NERDTreeFileExtensionHighlightFullName = 1
let g:NERDTreeExactMatchHighlightFullName = 1
let g:NERDTreePatternMatchHighlightFullName = 1
let g:NERDTreeHighlightFolders = 1 " enables folder icon highlighting using exact match
let g:NERDTreeHighlightFoldersFullName = 1 " highlights the folder name
let g:AutoPairsShortcutToggle = ''
let g:AutoPairsShortcutBackInsert = '<M-0>'
" ______ _ _ _
" | ____| | | | | (_)
" | |__ ___ _ __ _ __ ___ __ _| |_| |_ _ _ __ __ _
" | __/ _ \| '__| '_ ` _ \ / _` | __| __| | '_ \ / _` |
" | | | (_) | | | | | | | | (_| | |_| |_| | | | | (_| |
" |_| \___/|_| |_| |_| |_|\__,_|\__|\__|_|_| |_|\__, |
" __/ |
" |___/
let useformatting=1
function DoFormat()
if has("nvim") && g:useformatting
lua vim.lsp.buf.formatting_sync(nil, 1000)
endif
endfunction
if useformatting
"autocmd BufWritePre *.java call DoFormat()
autocmd BufWritePre *.md call DoFormat()
autocmd BufWritePre *.js call DoFormat()
autocmd BufWritePre *.ts call DoFormat()
autocmd BufWritePre *.clj call DoFormat()
autocmd BufWritePre *.html Neoformat
endif
command! ToggleFormatting let useformatting = (useformatting == 0 ? 1 : 0)
" _____
" | __ \
" | |__) |___ _ __ ___ __ _ _ __ ___
" | _ // _ \ '_ ` _ \ / _` | '_ \/ __|
" | | \ \ __/ | | | | | (_| | |_) \__ \
" |_| \_\___|_| |_| |_|\__,_| .__/|___/
" | |
" |_|
"
"Format, fucker
nnoremap <silent>ff <cmd>Neoformat<CR><Esc>:w<CR>
"Go to Def
nnoremap <silent>gd <cmd>lua vim.lsp.buf.definition()<CR>
" Docs pls
nnoremap <silent>K <cmd>lua vim.lsp.buf.hover()<CR>
" Params pls
inoremap <silent><C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
"ReName
nnoremap <Leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
"Explain error
nnoremap <Leader>ee <cmd>lua vim.diagnostic.show_line_diagnostics()<CR>
"Show error
nnoremap <Leader>se <cmd>lua vim.diagnostic.goto_next { wrap = true }<CR>
nnoremap <Leader>bn :bn<CR>
nnoremap <Leader>bp :bp<CR>
nnoremap <Leader>bl :bn<CR>
nnoremap <Leader>bh :bp<CR>
nnoremap <Leader>+ :vertical resize +5<CR>
nnoremap <Leader>- :vertical resize -5<CR>
" Undo break points
inoremap , ,<c-g>u
inoremap . .<c-g>u
inoremap ! !<c-g>u
inoremap ? ?<c-g>u
inoremap : :<c-g>u
inoremap ; ;<c-g>u
inoremap ; ;<c-g>u
" Jumplist mutations
nnoremap <expr> k (v:count > 5 ? "m'" . v:count : "") . 'k'
nnoremap <expr> j (v:count > 5 ? "m'" . v:count : "") . 'j'
" Previous file
nnoremap <Leader>pf <C-^>
imap <silent> <c-p> <Plug>(completion_trigger)
" Markdown preview
nmap <Leader>mp <Plug>MarkdownPreview
let g:mkdp_markdown_css = expand('~/dotfiles/markdown.css')
" commentary
noremap <Leader>cc :Commentary<CR>
noremap <Leader>cs {v}:Commentary<CR>
" Maximizer
nnoremap <Leader>fs :MaximizerToggle<CR>
" Nerdtree
nnoremap <Leader>ntf :NERDTreeFind<CR>