Created
January 4, 2021 23:25
-
-
Save op8867555/08e2b6fafad04aaa8c877fabb71c8ea9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin('~/.vim/plugged') | |
Plug 'editorconfig/editorconfig-vim' | |
" Status | |
Plug 'bling/vim-airline' | |
Plug 'lilydjwg/fcitx.vim' | |
" Bars, panels, and files | |
Plug 'scrooloose/nerdtree' | |
" Plug 'bling/vim-airline' | |
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': './install.sh' } | |
" Plug 'roxma/nvim-completion-manager' | |
Plug 'ncm2/ncm2' | |
" Plug 'ctrlpvim/ctrlp.vim' | |
Plug 'majutsushi/tagbar' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'benmills/vimux' | |
Plug 'neomake/neomake' | |
Plug 'vim-scripts/DrawIt' | |
" Git | |
Plug 'tpope/vim-fugitive' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'int3/vim-extradite' | |
" Haskell | |
Plug 'neovimhaskell/haskell-vim', { 'for': 'haskell' } | |
Plug 'parsonsmatt/intero-neovim', { 'for': 'haskell' } | |
Plug 'enomsg/vim-haskellConcealPlus', { 'for': 'haskell' } | |
" Theme | |
Plug 'Josheriff/semantic-highlight.vim' | |
" Plug 'IngoHeimbach/semantic-highlight.vim' | |
" Plug 'jaxbot/semantic-highlight.vim' | |
Plug 'vim-scripts/tir_black' | |
Plug 'chriskempson/base16-vim' | |
" Python | |
Plug 'davidhalter/jedi-vim', {'for': 'python'} | |
" Go | |
Plug 'fatih/vim-go', {'for': 'go'} | |
" Rust | |
Plug 'rust-lang/rust.vim', {'for': 'rust'} | |
Plug 'racer-rust/vim-racer', {'for': 'rust'} | |
" Pandoc | |
Plug 'vim-scripts/VOoM' | |
Plug 'vim-pandoc/vim-pandoc' | |
Plug 'vim-pandoc/vim-pandoc-syntax' | |
Plug 'rhysd/vim-grammarous', {'for': 'markdown'} | |
" GLSL | |
Plug 'tikhomirov/vim-glsl' | |
" Text manipulation | |
Plug 'vim-scripts/Align' | |
Plug 'simnalamburt/vim-mundo' | |
Plug 'tpope/vim-commentary' | |
Plug 'godlygeek/tabular' | |
Plug 'michaeljsmith/vim-indent-object' | |
Plug 'easymotion/vim-easymotion' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-abolish' | |
Plug 'tmhedberg/matchit' | |
Plug 'dhruvasagar/vim-table-mode' | |
call plug#end() | |
" }}} | |
set clipboard=unnamed | |
try | |
colorscheme base16-default-dark | |
if filereadable(expand("~/.vimrc_background")) | |
let base16colorspace=256 | |
source ~/.vimrc_background | |
endif | |
catch | |
endtry | |
" Set 7 lines to the cursor - when moving vertically using j/k | |
set so=7 | |
" Turn on the Wild menu | |
set wildmenu | |
" Tab-complete files up to longest unambiguous prefix | |
set wildmode=list:longest,full | |
" Always show current position | |
set ruler | |
set relativenumber | |
set number | |
set cursorline | |
autocmd InsertEnter * set rnu | |
autocmd InsertLeave * set nu | |
let g:airline_powerline_fonts=1 | |
" Show trailing whitespace | |
set list | |
" But only interesting whitespace | |
if &listchars ==# 'eol:$' | |
set listchars=tab:>\ ,trail:_,extends:>,precedes:<,nbsp:+ | |
endif | |
" Use par for prettier line formatting | |
set formatprg="PARINIT='rTbgqR B=.,?_A_a Q=_s>|' par\ -w72" | |
" Use indentation for folds | |
set foldmethod=indent | |
set foldnestmax=5 | |
set foldlevelstart=99 | |
set foldcolumn=0 | |
augroup vimrcFold | |
" fold vimrc itself by categories | |
autocmd! | |
autocmd FileType vim set foldmethod=marker | |
autocmd FileType vim set foldlevel=0 | |
augroup END | |
set nocompatible | |
syntax on | |
filetype plugin indent on | |
" speedup marcos | |
set lazyredraw | |
" | |
" Ignore case when searching | |
set ignorecase | |
" When searching try to be smart about cases | |
set smartcase | |
" Highlight search results | |
set hlsearch | |
" C-L to clean highlight | |
nnoremap <C-L> :nohlsearch<CR><C-L> | |
map <F9> :TagbarToggle<CR> | |
map <F12> :SemanticHighlightToggle<CR> | |
" modern search | |
set incsearch | |
" Kill the damned Ex mode. | |
nnoremap Q <nop> | |
" Open file prompt with current path | |
nmap <leader>e :e <C-R>=expand("%:p:h") . '/'<CR> | |
" Show undo tree | |
nmap <silent> <leader>u :MundoToggle<CR> | |
" don't close buffers when you aren't displaying them | |
set hidden | |
" makeview on each file | |
" autocmd BufWinLeave *.* mkview! | |
" autocmd BufWinEnter *.* silent loadview | |
set mouse=a | |
let g:NERDCustomDelimiters = {} | |
" Text, tab and indent related {{{ | |
" Use spaces instead of tabs | |
set expandtab | |
" Be smart when using tabs ;) | |
set smarttab | |
" 1 tab == 2 spaces | |
set shiftwidth=2 | |
set tabstop=2 | |
" Linebreak on 500 characters | |
set lbr | |
set tw=500 | |
set ai "Auto indent | |
set si "Smart indent | |
set wrap "Wrap lines | |
" }}} | |
" digraph {{{ | |
digraph [[ 10214 | |
digraph ]] 10215 | |
" }}} | |
" fzf {{{ | |
" Mapping selecting mappings | |
nmap <leader><tab> <plug>(fzf-maps-n) | |
xmap <leader><tab> <plug>(fzf-maps-x) | |
omap <leader><tab> <plug>(fzf-maps-o) | |
" | |
" Insert mode completion | |
imap <c-x><c-k> <plug>(fzf-complete-word) | |
imap <c-x><c-f> <plug>(fzf-complete-path) | |
imap <c-x><c-j> <plug>(fzf-complete-file-ag) | |
imap <c-x><c-l> <plug>(fzf-complete-line) | |
" Advanced customization using autoload functions | |
inoremap <expr> <c-x><c-k> fzf#vim#complete#word({'left': '15%'}) | |
" | |
nmap <leader><space> :Files<CR> | |
nmap <leader>t :Tags<CR> | |
nmap <leader>; :Buffers<CR> | |
" }}} | |
map <F7> :Neomake<CR> | |
" {{{ LanguageClient | |
let g:LanguageClient_serverCommands = {} | |
" let g:LanguageClient_loadSettings = 1 | |
nnoremap <silent> K :call LanguageClient_textDocument_hover()<CR> | |
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR> | |
nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR> | |
nnoremap <silent> <leader>k :call LanguageClient_textDocument_codeAction()<CR> | |
nnoremap <silent> <leader>= :call LanguageClient_textDocument_formatting()<CR> | |
nnoremap <silent> <leader>t :call LanguageClient#textDocument_signatureHelp()<CR> | |
" }}} | |
" let g:LanguageClient_serverCommands.pytest = ['tcp://127.0.0.1:8080'] | |
let g:LanguageClient_serverCommands.pytest = ['nc', '0.0.0.0', '8080'] | |
" {{{ C/C++ | |
autocmd FileType c let g:LanguageClient_settingsPath = '/home/requiem/.config/nvim/settings-c.json' | |
autocmd FileType cpp let g:LanguageClient_settingsPath = '/home/requiem/.config/nvim/settings-cpp.json' | |
let g:LanguageClient_serverCommands.c = ['ccls', '--log-file=/tmp/cq.log'] | |
let g:LanguageClient_serverCommands.cpp = ['ccls', '--log-file=/tmp/cq-cpp.log'] | |
" }}} | |
" {{{ Rust | |
set hidden | |
let g:racer_cmd = "~/.cargo/bin/racer" | |
let g:racer_experimental_completer = 1 | |
" When writing a buffer, and on normal mode changes (after 750ms). | |
autocmd FileType rust call neomake#configure#automake('nw', 750) | |
au FileType rust nmap gd <Plug>(rust-def) | |
autocmd FileType rust nmap K <Plug>(rust-doc) | |
" }}} | |
" Pandoc {{{ | |
" add CJK to spell langs | |
let g:pandoc#spell#default_langs=['en_us', 'cjk'] | |
let g:pandoc#syntax#use_definition_lists = 0 | |
autocmd FileType pandoc set iskeyword+=\- | |
autocmd FileType pandoc map <F9> :VoomToggle pandoc<CR> | |
" }}} | |
" Haskell {{{ | |
autocmd FileType haskell setlocal ts=4 sts=4 sw=4 ex | |
let g:LanguageClient_serverCommands.haskell = ['hie-wrapper', '--lsp'] | |
" {{{{ | |
" autocmd FileType haskell map <silent> <leader>t <Plug>InteroGenericType | |
" let g:LanguageClient_serverCommands.haskell = ['hie', '--lsp'] | |
" call SetLanguageClientKeys() | |
augroup interoMaps | |
au! | |
" Maps for intero. Restrict to Haskell buffers so the bindings don't collide. | |
" Background process and window management | |
au FileType haskell nnoremap <silent> <leader>is :InteroStart<CR> | |
au FileType haskell nnoremap <silent> <leader>ik :InteroKill<CR> | |
" Open intero/GHCi split horizontally | |
au FileType haskell nnoremap <silent> <leader>io :InteroOpen<CR> | |
" Open intero/GHCi split vertically | |
au FileType haskell nnoremap <silent> <leader>iov :InteroOpen<CR><C-W>H | |
au FileType haskell nnoremap <silent> <leader>ih :InteroHide<CR> | |
" Reloading (pick one) | |
" Automatically reload on save | |
"au BufWritePost *.hs InteroReload | |
" Manually save and reload | |
au FileType haskell nnoremap <silent> <leader>wr :w \| :InteroReload<CR> | |
" Load individual modules | |
au FileType haskell nnoremap <silent> <leader>il :InteroLoadCurrentModule<CR> | |
au FileType haskell nnoremap <silent> <leader>if :InteroLoadCurrentFile<CR> | |
" Type-related information | |
" Heads up! These next two differ from the rest. | |
au FileType haskell map <silent> <leader>t <Plug>InteroGenericType | |
au FileType haskell map <silent> <leader>T <Plug>InteroType | |
au FileType haskell nnoremap <silent> <leader>it :InteroTypeInsert<CR> | |
" Navigation | |
au FileType haskell nnoremap <silent> <leader>jd :InteroGoToDef<CR> | |
" Managing targets | |
" Prompts you to enter targets (no silent): | |
au FileType haskell nnoremap <leader>ist :InteroSetTargets<SPACE> | |
augroup END | |
" Intero starts automatically. Set this if you'd like to prevent that. | |
let g:intero_start_immediately = 0 | |
" }}}} | |
let g:haskell_enable_quantification = 1 | |
let g:haskell_enable_recursivedo = 1 | |
let g:haskell_enable_arrowsyntax = 1 | |
let g:haskell_enable_pattern_synonyms = 1 | |
let g:haskell_enable_typeroles = 1 | |
let g:haskell_enable_static_pointers = 1 | |
let g:haskell_backpack = 1 | |
let g:haskell_indent_if = 0 | |
let g:haskell_indent_do = 4 | |
let g:haskell_indent_in = 0 | |
let g:haskell_indent_let = 4 | |
" Turn off *Pretty unicode haskell symbols* | |
let g:haskell_conceal = 0 | |
let g:haskell_conceal_wide = 0 | |
let g:haskell_conceal_enumerations = 0 | |
let hscoptions="𝐒𝐓𝐄𝐌xRtB𝔻w" | |
" }}} | |
" {{{ Table | |
let g:table_mode_corner_corner='+' | |
let g:table_mode_header_fillchar='=' | |
" }}} | |
" {{{ Python | |
au FileType python let g:neomake_python_enabled_makers = ['flake8'] | |
let g:LanguageClient_serverCommands.python = ['pyls', '-v'] | |
" }}} | |
""" {{{ Java | |
let g:LanguageClient_serverCommands.java = ['jdtls', '-data', getcwd()] | |
""" }}} | |
""" {{{ Fortran | |
let fortran_free_source=1 | |
let fortran_have_tabs=1 | |
let fortran_more_precise=1 | |
let fortran_do_enddo=1 | |
""" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment