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.

127 lines
2.9 KiB

2 years ago
" (_)
" __ ___ _ __ ___ _ __ ___
" \ \ / / | '_ ` _ \| '__/ __|
" \ V /| | | | | | | | | (__
" \_/ |_|_| |_| |_|_| \___|
" theme {{{
1 year ago
syntax on
2 years ago
set background=dark
colorscheme solarized
" }}}
" plugins {{{
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive'
Plug 'pangloss/vim-javascript'
Plug 'justinmk/vim-dirvish'
Plug 'tpope/vim-surround'
Plug 'pangloss/vim-javascript'
Plug 'roxma/nvim-yarp'
1 year ago
Plug 'ncm2/ncm2'
2 years ago
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'
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:slime_target = "tmux"
1 year ago
let g:slime_default_config = {"socket_name": "default", "target_pane": ":.2"}
2 years ago
let g:lightline = {
\ 'colorscheme': 'solarized',
\ 'inactive': {
\ 'left': [ ['filename'] ],
\ 'right': []
\ }
\ }
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
1 year ago
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> <Plug>(dirvish_up)
nmap <C-A> <nop>
vmap <C-A> <nop>
nmap <C-X> <nop>
vmap <C-A> <nop>
2 years ago
nnoremap gn :GitGutterNextHunk<CR>
1 year ago
nnoremap gp :GitGutterPrevHunk<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>"
" }}}