2022-03-02 23:59:27 +01:00
|
|
|
"Not compatible with vi, which causes problems
|
|
|
|
set nocompatible
|
2022-03-21 16:28:49 +01:00
|
|
|
"Get filetype
|
2022-03-02 23:59:27 +01:00
|
|
|
filetype on
|
|
|
|
filetype plugin on
|
|
|
|
filetype indent on
|
2022-04-03 18:04:35 +02:00
|
|
|
filetype plugin indent on
|
2022-03-02 23:59:27 +01:00
|
|
|
"Plugins in ~/.vim/plugged
|
2022-02-03 04:52:48 +01:00
|
|
|
call plug#begin()
|
2022-04-15 19:21:01 +02:00
|
|
|
Plug 'jiangmiao/auto-pairs'
|
|
|
|
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
|
|
|
|
Plug 'arzg/vim-swift', { 'for': 'swift' }
|
|
|
|
Plug 'tyru/open-browser.vim'
|
|
|
|
Plug 'junegunn/vim-easy-align'
|
|
|
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
|
|
Plug 'junegunn/fzf.vim'
|
|
|
|
Plug 'preservim/NERDTree', { 'on': 'NERDTreeToggle' }
|
|
|
|
Plug 'itchyny/lightline.vim'
|
|
|
|
Plug 'tpope/vim-surround'
|
2022-04-17 20:46:16 +02:00
|
|
|
Plug 'prabirshrestha/async.vim'
|
2022-04-17 19:34:23 +02:00
|
|
|
Plug 'prabirshrestha/asyncomplete.vim'
|
2022-04-17 20:46:16 +02:00
|
|
|
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
2022-04-17 19:34:23 +02:00
|
|
|
Plug 'prabirshrestha/vim-lsp'
|
2022-04-17 20:46:16 +02:00
|
|
|
Plug 'prabirshrestha/asyncomplete-gocode.vim', { 'for': 'go' }
|
|
|
|
Plug 'keremc/asyncomplete-clang.vim', { 'for': ['c', 'cpp', 'h', 'hpp'] }
|
2022-04-17 19:34:23 +02:00
|
|
|
Plug 'mattn/vim-lsp-settings'
|
|
|
|
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
2022-04-15 19:21:01 +02:00
|
|
|
Plug 'https://github.com/KabbAmine/yowish.vim'
|
|
|
|
Plug 'https://github.com/ap/vim-css-color'
|
|
|
|
Plug 'digitaltoad/vim-pug', { 'for': 'pug' }
|
|
|
|
Plug 'ap/vim-buftabline'
|
|
|
|
Plug 'dracula/vim'
|
|
|
|
Plug 'fatih/vim-go', { 'for': 'go' }
|
|
|
|
Plug 'frazrepo/vim-rainbow'
|
|
|
|
Plug 'clojure-vim/clojure.vim', { 'for': 'clojure' }
|
2022-04-17 19:34:23 +02:00
|
|
|
Plug 'clojure-vim/async-clj-omni', { 'for': 'clojure' }
|
2022-04-15 19:21:01 +02:00
|
|
|
Plug 'vim-scripts/VimClojure', { 'for': 'clojure' }
|
2022-02-03 04:52:48 +01:00
|
|
|
call plug#end()
|
2022-03-21 16:28:49 +01:00
|
|
|
"Dracula > All
|
2022-02-03 04:52:48 +01:00
|
|
|
colorscheme dracula
|
|
|
|
syntax on
|
|
|
|
set ai
|
|
|
|
set number
|
2022-04-09 22:56:05 +02:00
|
|
|
set ts=4
|
|
|
|
set sw=4
|
2022-02-03 04:52:48 +01:00
|
|
|
set background=dark
|
|
|
|
set nowrap
|
2022-04-04 02:33:14 +02:00
|
|
|
set hidden
|
|
|
|
set showcmd
|
|
|
|
set wildmenu
|
|
|
|
set hlsearch
|
|
|
|
set confirm
|
|
|
|
set expandtab
|
2022-04-09 22:56:05 +02:00
|
|
|
"Buffer hopping
|
2022-02-03 04:52:48 +01:00
|
|
|
nmap <C-h> :bp<cr>
|
|
|
|
nmap <C-l> :bn<cr>
|
|
|
|
nmap <C-q> :Bclose<cr>
|
2022-04-09 22:56:05 +02:00
|
|
|
"Ripgrep with fzf
|
|
|
|
nmap <C-f> :Rg<cr>
|
2022-03-21 16:28:49 +01:00
|
|
|
"Nerd tree
|
2022-02-03 04:52:48 +01:00
|
|
|
nmap <S-w> :NERDTreeToggle<cr>
|
2022-03-21 16:28:49 +01:00
|
|
|
"For writing blog posts
|
|
|
|
autocmd BufNewFile,BufRead *.html,*.txt,*.blog set spell
|
|
|
|
autocmd BufNewFile,BufRead *.html,*.txt,*.blog set wrap
|
2022-04-17 19:34:23 +02:00
|
|
|
"Asyncomplete configurations
|
|
|
|
inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() . "\<cr>" : "\<cr>"
|
|
|
|
imap <c-space> <Plug>(asyncomplete_force_refresh)
|
|
|
|
function! s:check_back_space() abort
|
|
|
|
let col=col('.') - 1
|
|
|
|
return !col || getline('.')[col - 1] =~ '\s'
|
|
|
|
endfunction
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
|
|
\ pumvisible() ? "\<C-n>" :
|
|
|
|
\ <SID>check_back_space() ? "\<TAB>" :
|
|
|
|
\ asyncomplete#force_refresh()
|
|
|
|
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
|
|
|
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
|
|
|
|
"AUTO COMPLETES"
|
|
|
|
au User asyncomplete_setup call asyncomplete#register_source({
|
|
|
|
\ 'name': 'async_clj_omni',
|
|
|
|
\ 'whitelist': ['clojure'],
|
|
|
|
\ 'completor': function('async_clj_omni#sources#complete'),
|
|
|
|
\ })
|
2022-04-17 20:46:16 +02:00
|
|
|
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#gocode#get_source_options({
|
|
|
|
\ 'name': 'gocode',
|
|
|
|
\ 'allowlist': ['go'],
|
|
|
|
\ 'completor': function('asyncomplete#sources#gocode#completor'),
|
|
|
|
\ 'config': {
|
|
|
|
\ 'gocode_path': expand('~/go/bin/gocode')
|
|
|
|
\ },
|
|
|
|
\ }))
|
|
|
|
au User asyncomplete_setup call asyncomplete#register_source(
|
|
|
|
\ asyncomplete#sources#clang#get_source_options({
|
|
|
|
\ 'config': {
|
|
|
|
\ 'clang_path': '/usr/bin/clang',
|
|
|
|
\ 'clang_args': {
|
|
|
|
\ 'cpp': ['-std=c++11']
|
|
|
|
\ }
|
|
|
|
\ }
|
|
|
|
\}))
|
2022-04-17 19:34:23 +02:00
|
|
|
""Load only on Lisp, Clojure, or Emacs Lisp files for rainbow parens
|
2022-03-21 16:41:33 +01:00
|
|
|
au FileType clojure,lisp,lsp,cl,l,el,elc,eln call rainbow#load()
|
|
|
|
"Toggle on rainbow parens by default if the following file type is detected
|
|
|
|
let fts=['clojure', 'lisp', 'lsp', 'cl', 'el', 'eln', 'l', 'elc']
|
|
|
|
if index(fts, &filetype) != -1
|
2022-04-15 19:21:01 +02:00
|
|
|
"Clojure style standards like 2 space indents check it out:
|
|
|
|
"https://guide.clojure.style
|
|
|
|
set ts=2
|
|
|
|
set sw=2
|
|
|
|
:RainbowToggle
|
2022-03-21 16:28:49 +01:00
|
|
|
endif
|
2022-04-15 19:21:42 +02:00
|
|
|
"Configure clojure fuzzy indents and alignments
|
|
|
|
let g:clojure_fuzzy_indent=1
|
|
|
|
let g:clojure_align_subforms=1
|
2022-04-15 19:21:01 +02:00
|
|
|
"Fix weird background color issues with dracula color scheme
|
2022-04-03 18:19:28 +02:00
|
|
|
if &term =~ '256color'
|
2022-04-15 19:21:01 +02:00
|
|
|
set t_ut=
|
2022-04-03 18:19:28 +02:00
|
|
|
endif
|