You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
3.9 KiB

2 years ago
" (_)
" __ ___ _ __ ___ _ __ ___
" \ \ / / | '_ ` _ \| '__/ __|
" \ V /| | | | | | | | | (__
" \_/ |_|_| |_| |_|_| \___|
syntax on
" theme {{{
set background=dark
colorscheme solarized
" }}}
" plugins {{{
call plug#begin('~/.vim/plugged')
2 years ago
Plug '~/.vim/plugins/paint.vim'
Plug '~/.vim/plugins/sep.vim'
2 years ago
Plug 'wannesm/wmgraphviz.vim'
Plug 'weirongxu/plantuml-previewer.vim'
Plug 'aklt/plantuml-syntax'
Plug 'tyru/open-browser.vim'
Plug 'tpope/vim-fugitive'
Plug 'roginfarrer/vim-dirvish-dovish', {'branch': 'main'}
Plug 'pangloss/vim-javascript'
Plug 'justinmk/vim-dirvish'
Plug 'tpope/vim-surround'
Plug 'godlygeek/tabular'
Plug 'pangloss/vim-javascript'
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-path'
Plug 'ncm2/ncm2-jedi'
Plug 'ncm2/ncm2-tagprefix'
Plug 'jpalardy/vim-slime', { 'branch': 'main' }
Plug 'tpope/vim-commentary'
Plug 'itchyny/lightline.vim'
Plug 'dense-analysis/ale'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-surround'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'SirVer/ultisnips'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'dhruvasagar/vim-table-mode'
2 years ago
Plug 'tmhedberg/SimpylFold'
2 years ago
call plug#end()
" }}}
" options {{{
set rtp-=~/.vim/after
set rtp+=~/.vim/after
set formatoptions=o
set comments=b:#
set listchars+=space:.
set number
set sw=4 ts=4 sts=4 autoindent noexpandtab
set modeline
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set wrap
set breakindentopt=shift:3,min:40,sbr
set breakindent
set linebreak
set ignorecase
set smartcase
set hlsearch
set incsearch
set mat=2
set cursorline
set visualbell
set colorcolumn=80
set splitbelow
set splitright
set spelllang=en_gb
set spellfile=~/.vim/spell/en.utf-8.add
function! FoldText()
return repeat(" ", indent(v:foldstart)) . trim(getline(v:foldstart))[0:-1] . " +" . repeat(" ", winwidth(0))
endfunction
set foldtext=FoldText()
set foldenable
set foldmethod=marker
set foldopen-=block
set completeopt=noinsert,menuone,noselect
set shortmess+=c
au TermOpen * setlocal nonumber
" }}}
" variables {{{
2 years ago
let g:python3_host_prog="~/.env/bin/python"
2 years ago
let g:netrw_liststyle = 4
let g:netrw_banner = 0
let g:slime_target = "tmux"
let g:slime_paste_file = "$HOME/.slime_paste"
let g:slime_default_config = {"socket_name": get(split($TMUX, ","), 0), "target_pane": ":.2"}
let g:lightline = {
\ 'colorscheme': 'solarized',
\ 'inactive': {
\ 'left': [ ['filename'] ],
\ 'right': []
\ }
\ }
let g:dirvish_dovish_map_keys = 0
let g:ale_lint_on_save = 1
2 years ago
let g:ale_fix_on_save = 0
let g:ale_python_auto_virtualenv = 1
let g:ale_python_flake8_use_global = 0
2 years ago
" }}}
" mappings {{{
nnoremap <expr> x ((foldclosed('.')==-1)?('x'):('zo0x'))
nnoremap <Down> <C-\><C-n><C-W><C-J>
nnoremap <Up> <C-\><C-n><C-W><C-K>
nnoremap <Right> <C-\><C-n><C-W><C-L>
nnoremap <Left> <C-\><C-n><C-W><C-H>
nnoremap = <C-W>=
tnoremap <Esc> <C-\><C-n>
nnoremap <Esc> <Esc>:noh<cr>
inoremap <expr> <down> pumvisible() ? "\<c-n>" : "\<down>"
inoremap <expr> <up> pumvisible() ? "\<c-p>" : "\<up>"
" nmap <backspace> :e %:h<CR>
nmap <backspace> <Plug>(dirvish_up)
nnoremap <leader>? :echom "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
2 years ago
" nnoremap <leader>gn :GitGutterNextHunk
" nnoremap <leader>gN :GitGutterPreviousHunk
2 years ago
nmap <C-A> <nop>
vmap <C-A> <nop>
nmap <C-X> <nop>
vmap <C-A> <nop>
nnoremap <C-W>right :tabn
nnoremap <C-W>left :tabp
nnoremap <C-W>c :tabnew
nnoremap <C-W>x :tabclose
2 years ago
nnoremap gn :GitGutterNextHunk<CR>
nnoremap gp :GitGutterPreviousHunk<CR>
2 years ago
" }}}
" autocommands {{{
autocmd BufEnter * call ncm2#enable_for_buffer()
augroup CursorLineOnlyInActiveWindow
autocmd!
autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
augroup END
" }}}
" commands {{{
command -nargs=1 GitDiff execute "normal! :Gvdiffsplit ".<f-args>."\<CR>"
" }}}