commit
225a30965c
19 changed files with 6222 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||
/bundle/ |
|||
/.netrwhist |
|||
/.swp/ |
|||
/.undo/ |
|||
/.backup/ |
|||
.old |
|||
/black/ |
|||
/sessions/ |
|||
/view/ |
@ -0,0 +1,13 @@ |
|||
#!/usr/bin/env bash |
|||
|
|||
|
|||
sudo pacman -Sy \ |
|||
base-devel \ |
|||
prettier \ |
|||
yapf \ |
|||
autopep8 \ |
|||
python-black \ |
|||
mypy \ |
|||
python-greenlet |
|||
|
|||
pip3 install --user pynvim |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,74 @@ |
|||
" Vim color file |
|||
" Maintainer: Andrés Suárez <ansuga@gmail.com> |
|||
" Last Change: 2009/02/10 Tue 16:55 |
|||
" version: 1.2 |
|||
" This color scheme uses a light background. |
|||
|
|||
set background=light |
|||
hi clear |
|||
if exists("syntax_on") |
|||
syntax reset |
|||
endif |
|||
|
|||
let colors_name = "fruidle" |
|||
|
|||
" Normal |
|||
hi Normal guifg=#404040 guibg=#ffffff |
|||
|
|||
" Search |
|||
hi IncSearch gui=UNDERLINE guifg=#404040 guibg=#40ffff |
|||
hi Search gui=NONE guifg=#404040 guibg=#ffff60 |
|||
|
|||
" Messages |
|||
hi ErrorMsg gui=NONE guifg=#ff0000 guibg=#ffe4e4 |
|||
hi WarningMsg gui=NONE guifg=#ff0000 guibg=#ffe4e4 |
|||
hi ModeMsg gui=NONE guifg=#dd0000 guibg=NONE |
|||
hi MoreMsg gui=NONE guifg=#009070 guibg=NONE |
|||
hi Question gui=NONE guifg=#ff7700 guibg=NONE |
|||
|
|||
" Split area |
|||
hi StatusLine gui=BOLD guifg=#f8f8f8 guibg=#404040 |
|||
hi StatusLineNC gui=NONE guifg=#a4a4a4 guibg=#404040 |
|||
hi VertSplit gui=NONE guifg=#f8f8f8 guibg=#404040 |
|||
hi WildMenu gui=BOLD guifg=#f8f8f8 guibg=#dd0000 |
|||
|
|||
" Diff |
|||
hi DiffText gui=NONE guifg=#e04040 guibg=#ffd8d8 |
|||
hi DiffChange gui=NONE guifg=#408040 guibg=#d0f0d0 |
|||
hi DiffDelete gui=NONE guifg=#4848ff guibg=#ffd0ff |
|||
hi DiffAdd gui=NONE guifg=#4848ff guibg=#ffd0ff |
|||
|
|||
" Cursor |
|||
hi Cursor gui=NONE guifg=#0000ff guibg=#00e0ff |
|||
hi lCursor gui=NONE guifg=#f8f8f8 guibg=#8000ff |
|||
hi CursorIM gui=NONE guifg=#f8f8f8 guibg=#8000ff |
|||
|
|||
" Fold |
|||
hi Folded gui=NONE guifg=#20605c guibg=#b8e8dc |
|||
hi FoldColumn gui=NONE guifg=#40a098 guibg=#f0f0f0 |
|||
|
|||
" Other |
|||
hi Directory gui=NONE guifg=#0070b8 guibg=NONE |
|||
hi LineNr gui=NONE guifg=#acacac guibg=NONE |
|||
hi NonText gui=BOLD guifg=#00a0c0 guibg=#ececec |
|||
hi SpecialKey gui=NONE guifg=#4040ff guibg=NONE |
|||
hi Title gui=NONE guifg=#0050a0 guibg=#c0e8ff |
|||
hi Visual gui=NONE guifg=#484848 guibg=#e0e0e0 |
|||
" hi VisualNOS gui=NONE guifg=#484848 guibg=#e0e0e0 |
|||
|
|||
" Syntax group |
|||
hi Comment gui=NONE guifg=#dd0000 guibg=NONE |
|||
hi Constant gui=NONE guifg=#0070e6 guibg=NONE |
|||
hi Number gui=NONE guifg=#aa0094 guibg=NONE |
|||
hi Identifier gui=NONE guifg=#0070e6 guibg=NONE |
|||
hi Error gui=BOLD guifg=#ffffff guibg=#dd0000 |
|||
hi Ignore gui=NONE guifg=#f8f8f8 guibg=NONE |
|||
hi PreProc gui=BOLD guifg=#e06800 guibg=NONE |
|||
hi Special gui=NONE guifg=#4a9400 guibg=NONE |
|||
hi Statement gui=NONE guifg=#ff7700 guibg=NONE |
|||
hi Todo gui=UNDERLINE guifg=#ff0070 guibg=#ffe0f4 |
|||
hi Type gui=BOLD guifg=#0070e6 guibg=NONE |
|||
hi Underlined gui=UNDERLINE guifg=fg guibg=NONE |
|||
hi Include gui=BOLD guifg=#dd0000 guibg=NONE |
|||
hi Function gui=BOLD guifg=#00aa00 guibg=NONE |
|||
hi String gui=NONE guifg=#00aa00 ctermfg=1 |
@ -0,0 +1,46 @@ |
|||
" Attempt to replicate GitHub's Golang colorscheme |
|||
" on a dark background |
|||
" John Arundel, Bitfield Consulting john@bitfieldconsulting.com |
|||
let g:colors_name="gitgo" |
|||
|
|||
hi Normal ctermfg=252 guifg=#3a2a2e guibg=#fafafa |
|||
hi Number ctermfg=252 guifg=#3a2a2e guibg=#fafafa |
|||
hi Special ctermfg=252 guifg=#3a2a2e guibg=#fafafa |
|||
hi String ctermfg=252 guifg=#3a2a2e guibg=#fafafa |
|||
hi goTypeConstructor ctermfg=252 guifg=#3a2a2e guibg=#fafafa |
|||
hi Identifier ctermfg=252 guifg=#3a2a2e guibg=#fafafa |
|||
hi Constant ctermfg=135 guifg=#0f67cb guibg=#fafafa |
|||
hi Comment ctermfg=59 guifg=#787878 guibg=#fafafa |
|||
hi Boolean ctermfg=69 guifg=#618dfa guibg=#fafafa |
|||
hi goPredefinedIdentifiers ctermfg=69 guifg=#0f67c1 guibg=#fafafa |
|||
hi Function ctermfg=69 guifg=#6c4bbf guibg=#fafafa |
|||
hi goMethodCall ctermfg=69 guifg=#0f67cb guibg=#fafafa |
|||
hi goFunctionCall ctermfg=69 guifg=#0f67cb guibg=#fafafa |
|||
hi goFormatSpecifier ctermfg=69 guifg=#618dfa guibg=#fafafa |
|||
hi keyword ctermfg=9 guifg=#0f67cb gui=none guibg=#fafafa |
|||
hi Statement ctermfg=9 guifg=#d25e3b gui=none guibg=#fafafa |
|||
hi PreProc ctermfg=9 guifg=#d25e3b gui=none guibg=#fafafa |
|||
hi Type ctermfg=166 guifg=#de6125 gui=none guibg=#fafafa |
|||
hi goSimpleArguments ctermfg=166 guifg=#3a2a2e guibg=#fafafa |
|||
hi goArgumentName ctermfg=166 guifg=#de6125 guibg=#fafafa |
|||
hi goArgumentType ctermfg=166 guifg=#de6125 guibg=#fafafa |
|||
|
|||
" complete menu |
|||
hi Pmenu ctermfg=81 ctermbg=235 guibg=#ccccff |
|||
hi PmenuSel ctermfg=235 ctermbg=81 guibg=#eeeeff |
|||
|
|||
" screen furniture |
|||
hi VertSplit ctermfg=0 guifg=#fafafa guibg=#fafafa |
|||
hi CursorLine guifg=#fafafa guibg=#3a2a2e |
|||
|
|||
" GoCoverage support |
|||
hi def link goCoverageNormalText Comment |
|||
hi def goCoverageCovered ctermfg=green guifg=#00aa00 guibg=#fafafa |
|||
hi def goCoverageUncover ctermfg=red guifg=#ff0000 guibg=#fafafa |
|||
|
|||
" Directory browser |
|||
:hi Directory ctermfg=69 guifg=#0f67cb guibg=#fafafa |
|||
|
|||
" Misc |
|||
hi Title ctermfg=69 guifg=#6c4bbf guibg=#fafafa |
|||
hi CtrlPMatch ctermfg=69 guifg=#0f67cb guibg=#fafafa gui=bold |
@ -0,0 +1 @@ |
|||
au BufNewFile,BufRead Dockerfile* set filetype=groovy |
@ -0,0 +1 @@ |
|||
"autocmd BufNewFile,BufRead *.go colorscheme gitgo |
@ -0,0 +1 @@ |
|||
autocmd FileType gpl setlocal autoindent noexpandtab tabstop=4 shiftwidth=4 |
@ -0,0 +1 @@ |
|||
au BufNewFile,BufRead Jenkinsfile set filetype=groovy |
@ -0,0 +1,4 @@ |
|||
augroup vala |
|||
au! |
|||
autocmd BufNewFile,BufRead *.vala,*.vapi,*.genie set syntax=vala ft=vala |
|||
augroup END |
@ -0,0 +1 @@ |
|||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab |
@ -0,0 +1 @@ |
|||
../bundle/vim-yara/ftdetect/yara.vim |
@ -0,0 +1,3 @@ |
|||
setlocal tabstop=2 shiftwidth=2 |
|||
|
|||
let b:ale_fixers = ['dartfmt'] |
@ -0,0 +1 @@ |
|||
setlocal noexpandtab tabstop=4 shiftwidth=4 |
@ -0,0 +1,87 @@ |
|||
setlocal expandtab |
|||
setlocal colorcolumn=88 |
|||
setlocal textwidth=88 |
|||
" Enable comment continuation. |
|||
" setlocal formatoptions+=cro |
|||
" setlocal foldmethod=indent |
|||
" setlocal foldminlines=10 |
|||
" setlocal textwidth=0 |
|||
|
|||
" Multi-line commenting and uncommenting. |
|||
" vmap <buffer> <C-m> :s/^\(\s*\)/\1#/<Return> |
|||
" vmap <buffer> <C-,> :s/^\(\s*\)#/\1/<Return> |
|||
|
|||
" Use the AutoPythonImport tool. |
|||
" map <buffer> <C-n> :call AutoPythonImport(expand("<cword>"))<Return> |
|||
|
|||
" Change the line length for Python files based on configuration files. |
|||
function! ChangePythonLineLength() abort |
|||
let l:conf = ale#path#FindNearestFile(bufnr(''), 'setup.cfg') |
|||
" Reset settings back to defaults when configuration files are not found |
|||
let l:line_length = 79 |
|||
|
|||
if !empty(l:conf) |
|||
for l:match in ale#util#GetMatches( |
|||
\ readfile(l:conf), |
|||
\ '\v^ *max-line-length *\= *(\d+)', |
|||
\) |
|||
let l:line_length = str2nr(l:match[1]) |
|||
endfor |
|||
endif |
|||
|
|||
let &l:colorcolumn = l:line_length + 1 |
|||
endfunction |
|||
|
|||
" call ChangePythonLineLength() |
|||
|
|||
let b:ale_linters = ['flake8', 'mypy'] |
|||
let b:ale_fixers = [ |
|||
\ 'autopep8', |
|||
\ 'yapf', |
|||
\ 'black', |
|||
\] |
|||
let b:ale_completion_excluded_words = ['and', 'or', 'if'] |
|||
" let g:ale_pattern_options = {'suite_py': {'ale_fixers': []}} |
|||
|
|||
if expand('%:e') is# 'pyi' |
|||
let b:ale_linters = ['mypy'] |
|||
endif |
|||
|
|||
map <buffer> <silent> <F9> :TestFile<CR> |
|||
|
|||
let s:virtualenv = ale#python#FindVirtualenv(bufnr('')) |
|||
|
|||
if !empty(s:virtualenv) |
|||
if executable(s:virtualenv . '/bin/pytest') |
|||
let g:test#python#runner = 'pytest' |
|||
let g:test#python#pytest#executable = |
|||
\ ale#path#CdString(ale#path#Dirname(s:virtualenv)) |
|||
\ . ale#Escape(s:virtualenv . '/bin/pytest') |
|||
else |
|||
let g:test#python#runner = 'djangotest' |
|||
let g:test#python#djangotest#executable = |
|||
\ ale#Escape(s:virtualenv . '/bin/python') |
|||
\ . ' ' . ale#Escape(ale#path#Dirname(s:virtualenv) . '/manage.py') . ' test' |
|||
endif |
|||
endif |
|||
|
|||
if !exists("g:python_debugger") |
|||
let g:python_debugger = 'ipdb' |
|||
endif |
|||
let g:python_debug_line = 'import ' . g:python_debugger . '; ' . g:python_debugger . '.set_trace()' |
|||
|
|||
function! InsertBreakpoint() abort |
|||
:normal o * |
|||
let l:curr_indent = indent(line(".")) - 1 |
|||
let l:line = '' |
|||
:delete |
|||
:normal k |
|||
while l:curr_indent > 0 |
|||
let l:line .= ' ' |
|||
let l:curr_indent -= 1 |
|||
endwhile |
|||
let l:line = l:line . g:python_debug_line |
|||
:put =l:line |
|||
endfunction |
|||
|
|||
nnoremap <leader>d :call InsertBreakpoint()<CR> |
@ -0,0 +1 @@ |
|||
autocmd FileType typescript setlocal formatprg=prettier\ --parser\ typescript |
@ -0,0 +1,24 @@ |
|||
ignoreGeneratedHeader = false |
|||
severity = "warning" |
|||
confidence = 0.8 |
|||
errorCode = 0 |
|||
warningCode = 0 |
|||
|
|||
[rule.blank-imports] |
|||
[rule.context-as-argument] |
|||
[rule.context-keys-type] |
|||
[rule.dot-imports] |
|||
[rule.error-return] |
|||
[rule.error-strings] |
|||
[rule.error-naming] |
|||
[rule.if-return] |
|||
[rule.increment-decrement] |
|||
[rule.var-naming] |
|||
[rule.var-declaration] |
|||
[rule.package-comments] |
|||
[rule.range] |
|||
[rule.receiver-naming] |
|||
[rule.time-naming] |
|||
[rule.unexported-return] |
|||
[rule.indent-error-flow] |
|||
[rule.errorf] |
@ -0,0 +1,670 @@ |
|||
let $VIMHOME = expand('~/.vim') |
|||
let s:sep = has('win32') ? '\' : '/' |
|||
" check if in tty |
|||
let g:is_tty = system('case $(tty) in (/dev/tty[0-9]) echo 1;; (*) echo 0;; esac') |
|||
|
|||
" vim-plug init |
|||
if empty(glob('~/.vim/autoload/plug.vim')) |
|||
system('curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim') |
|||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC |
|||
endif |
|||
|
|||
""" Set python3 path |
|||
let g:python3_host_prog = "/usr/bin/python" |
|||
let g:python_host_prog='/usr/bin/python' |
|||
|
|||
call plug#begin('~/.vim/bundle') |
|||
|
|||
""" Install Plugs |
|||
" clipboard |
|||
Plug 'haya14busa/vim-poweryank' |
|||
|
|||
" undotree |
|||
Plug 'mbbill/undotree' |
|||
|
|||
" vim-fetch |
|||
Plug 'wsdjeg/vim-fetch' |
|||
|
|||
" powerline-vim |
|||
Plug 'powerline/powerline' |
|||
|
|||
" vim-eunuch |
|||
Plug 'tpope/vim-eunuch' |
|||
|
|||
" vim-commentary |
|||
Plug 'tpope/vim-commentary' |
|||
|
|||
" vim-markbar |
|||
Plug 'Yilin-Yang/vim-markbar' |
|||
|
|||
" vim-rooter |
|||
Plug 'airblade/vim-rooter' |
|||
|
|||
" win-resizer |
|||
Plug 'simeji/winresizer' |
|||
|
|||
" Deoplete.vim |
|||
Plug 'Shougo/deoplete.nvim' |
|||
Plug 'roxma/nvim-yarp' |
|||
Plug 'roxma/vim-hug-neovim-rpc' |
|||
Plug 'deoplete-plugins/deoplete-go', { 'do': 'make' } |
|||
Plug 'deoplete-plugins/deoplete-jedi' |
|||
let g:deoplete#enable_at_startup = 1 |
|||
|
|||
" neosnippets |
|||
"Plug 'Shougo/neosnippet.vim' |
|||
"Plug 'Shougo/neosnippet-snippets' |
|||
|
|||
" fzf |
|||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } |
|||
Plug 'junegunn/fzf.vim' |
|||
|
|||
" Peekaboo |
|||
Plug 'junegunn/vim-peekaboo' |
|||
|
|||
" NERDTree |
|||
Plug 'scrooloose/nerdtree' |
|||
Plug 'Xuyuanp/nerdtree-git-plugin' |
|||
|
|||
" NERTCommenter |
|||
Plug 'scrooloose/nerdcommenter' |
|||
|
|||
" tagbar |
|||
" Plug 'majutsushi/tagbar' |
|||
|
|||
" vim-fugitive |
|||
Plug 'tpope/vim-fugitive' |
|||
|
|||
" dadbod (sql) |
|||
Plug 'tpope/vim-dadbod' |
|||
|
|||
" yara |
|||
Plug 'yaunj/vim-yara' |
|||
|
|||
" Dart |
|||
" Plug 'bartekd/vim-dart' |
|||
Plug 'dart-lang/dart-vim-plugin' |
|||
|
|||
" Kotlin |
|||
Plug 'udalov/kotlin-vim' |
|||
|
|||
" Elixir |
|||
Plug 'elixir-editors/vim-elixir' |
|||
" Plug 'GrzegorzKozub/vim-elixirls', { 'do': ':ElixirLsCompileSync' } |
|||
|
|||
" Elm |
|||
"Plug 'elmcast/elm-vim' |
|||
"Plug 'andys8/vim-elm-syntax' |
|||
"let g:elm_format_autosave = 1 |
|||
"Plug 'Zaptic/elm-vim' |
|||
|
|||
" GraphQL |
|||
Plug 'jparise/vim-graphql' |
|||
|
|||
" Scss |
|||
Plug 'cakebaker/scss-syntax.vim' |
|||
|
|||
" Vala |
|||
Plug 'arrufat/vala.vim' |
|||
|
|||
" ALE |
|||
"Plug 'w0rp/ale' |
|||
Plug 'dense-analysis/ale' |
|||
let g:ale_completion_enabled = 0 |
|||
|
|||
" LanguageClient |
|||
Plug 'autozimu/LanguageClient-neovim', { |
|||
\ 'branch': 'next', |
|||
\ 'do': 'bash install.sh', |
|||
\ } |
|||
|
|||
" vim-airline |
|||
"Plug 'vim-airline/vim-airline' |
|||
"Plug 'vim-airline/vim-airline-themes' |
|||
|
|||
" Colorschemes |
|||
Plug 'junegunn/seoul256.vim' |
|||
Plug 'scwood/vim-hybrid' |
|||
Plug 'kristijanhusak/vim-hybrid-material' |
|||
Plug 'srcery-colors/srcery-vim' |
|||
Plug 'nightsense/cosmic_latte' |
|||
Plug 'rafi/awesome-vim-colorschemes' |
|||
Plug 'altercation/vim-colors-solarized' |
|||
Plug 'franbach/miramare' |
|||
Plug 'sainnhe/edge' |
|||
Plug 'ayu-theme/ayu-vim' |
|||
Plug 'bitfield/vim-gitgo' |
|||
Plug 'savq/melange' |
|||
Plug 'sonph/onehalf', { 'rtp': 'vim' } |
|||
|
|||
" indent-guides |
|||
Plug 'nathanaelkane/vim-indent-guides' |
|||
|
|||
" Dockerfile.vim |
|||
Plug 'ekalinin/Dockerfile.vim' |
|||
|
|||
" YAML |
|||
Plug 'mrk21/yaml-vim' |
|||
|
|||
" Python |
|||
Plug 'ambv/black' |
|||
|
|||
" TOML |
|||
Plug 'cespare/vim-toml' |
|||
|
|||
" Autoclose |
|||
Plug 'jiangmiao/auto-pairs' |
|||
|
|||
" vim-go |
|||
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } |
|||
|
|||
" vim-multiple-cursor |
|||
Plug 'terryma/vim-multiple-cursors' |
|||
|
|||
" rust.vim |
|||
" Plug 'rust-lang/rust.vim' |
|||
|
|||
" nginx.vim |
|||
Plug 'chr4/nginx.vim' |
|||
|
|||
" typescript |
|||
|
|||
Plug 'HerringtonDarkholme/yats.vim' |
|||
"Plug 'leafgarland/typescript-vim' |
|||
Plug 'ianks/vim-tsx' |
|||
Plug 'maxmellon/vim-jsx-pretty' |
|||
"Plug 'mhartington/nvim-typescript', {'do': './install.sh'} |
|||
|
|||
|
|||
call plug#end() |
|||
|
|||
""" |
|||
|
|||
""" vim-rooter |
|||
|
|||
"let g:rooter_change_directory_for_non_project_files = 'current': |
|||
|
|||
""" neosnippets |
|||
|
|||
" Plugin key-mappings. |
|||
" Note: It must be "imap" and "smap". It uses <Plug> mappings. |
|||
imap <C-k> <Plug>(neosnippet_expand_or_jump) |
|||
smap <C-k> <Plug>(neosnippet_expand_or_jump) |
|||
xmap <C-k> <Plug>(neosnippet_expand_target) |
|||
|
|||
" SuperTab like snippets behavior. |
|||
" Note: It must be "imap" and "smap". It uses <Plug> mappings. |
|||
"imap <expr><TAB> |
|||
" \ pumvisible() ? "\<C-n>" : |
|||
" \ neosnippet#expandable_or_jumpable() ? |
|||
" \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>" |
|||
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? |
|||
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>" |
|||
|
|||
" For conceal markers. |
|||
if has('conceal') |
|||
set conceallevel=2 concealcursor=niv |
|||
endif |
|||
|
|||
""" LanguageClient |
|||
" Required for operations modifying multiple buffers like rename. |
|||
set hidden |
|||
|
|||
" let g:LanguageClient_serverCommands = { |
|||
" \ 'javascript': ['/usr/local/bin/javascript-typescript-stdio'], |
|||
" \ 'javascript.jsx': ['tcp://127.0.0.1:2089'], |
|||
" \ 'python': ['/usr/local/bin/pyls'], |
|||
" \ 'ruby': ['~/.rbenv/shims/solargraph', 'stdio'], |
|||
" \ } |
|||
|
|||
let g:LanguageClient_serverCommands = { |
|||
\ 'rust': ['/usr/bin/rustup', 'run', 'stable', 'rls'], |
|||
\ 'elixir': ['/usr/lib/elixir-ls/language_server.sh'], |
|||
\ 'elm': ['/usr/bin/elm-language-server'], |
|||
\ 'python': ['/usr/bin/pyls'], |
|||
\ 'go': ['/usr/bin/gopls'], |
|||
\ } |
|||
|
|||
let g:LanguageClient_rootMarkers = { |
|||
\ 'elm': ['elm.json'], |
|||
\ } |
|||
|
|||
" note that if you are using Plug mapping you should not use `noremap` mappings. |
|||
nmap <F5> <Plug>(lcn-menu) |
|||
" Or map each action separately |
|||
nmap <silent>K <Plug>(lcn-hover) |
|||
nmap <silent> gd <Plug>(lcn-definition) |
|||
nmap <silent> <F2> <Plug>(lcn-rename) |
|||
|
|||
""" ALE configuration |
|||
|
|||
let g:ale_sign_error = '->' |
|||
let g:ale_sign_warning = '~>' |
|||
" let g:ale_sign_error = '✘' |
|||
" let g:ale_sign_warning = '⚠' |
|||
|
|||
if has('nvim') |
|||
let s:user_dir = stdpath('config') |
|||
else |
|||
let s:user_dir = has('win32') ? expand('~/vimfiles') : expand('~/.vim') |
|||
endif |
|||
|
|||
let g:ale_elixir_elixir_ls_release = '/usr/lib/elixir-ls/' |
|||
|
|||
let g:ale_linters = { |
|||
\ 'javascript': ['eslint'], |
|||
\ 'typescript': ['tsserver', 'tslint'], |
|||
\ 'python': ['pyls', 'pylint'], |
|||
\ 'rust': ['rls'], |
|||
\ 'elixir': ['elixir-ls'], |
|||
\ 'go': ['gopls'], |
|||
\ 'json': ['jsonlint'], |
|||
\ 'dockerfile': ['hadolint'], |
|||
\ 'vala': ['vala-language-server'], |
|||
\ 'scss': ['eslint'], |
|||
\ 'elm': ['elm_ls'], |
|||
\} |
|||
|
|||
let g:ale_fixers = { |
|||
\ 'javascript': ['prettier'], |
|||
\ 'typescript': ['prettier'], |
|||
\ 'python': ['black', 'pyls'], |
|||
\ 'rust': ['rustfmt'], |
|||
\ 'elixir': ['mix_format'], |
|||
\ 'graphql': ['prettier'], |
|||
\ 'perl': ['perltidy'], |
|||
\ 'go': ['gofmt'], |
|||
\ 'json': ['prettier'], |
|||
\ 'vala': ['uncrustify'], |
|||
\ 'dart': ['dartfmt'], |
|||
\ 'scss': ['prettier'], |
|||
\} |
|||
|
|||
function! s:getValaProjectRoot(buffer) abort |
|||
let l:cur_path_abs = fnamemodify(a:buffer, ':p:h') |
|||
let l:maybe_doap_file = expand(l:cur_path_abs . s:sep . '*.doap') |
|||
if !empty(l:maybe_doap_file) |
|||
return l:cur_path_abs |
|||
endif |
|||
|
|||
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h')) |
|||
if filereadable(expand(l:path . '*.doap')) |
|||
return l:path |
|||
endif |
|||
endfor |
|||
|
|||
return '' |
|||
endfunction |
|||
|
|||
call ale#linter#Define('vala', { |
|||
\ 'name': 'vala-language-server', |
|||
\ 'lsp': 'stdio', |
|||
\ 'output_stream': 'both', |
|||
\ 'executable': '/usr/bin/vala-language-server', |
|||
\ 'command': '%e', |
|||
\ 'project_root': function('s:getValaProjectRoot'), |
|||
\ 'callback': 'ale#handlers#unix#HandleAsWarning', |
|||
\}) |
|||
|
|||
let g:ale_rust_rls_config = { |
|||
\ 'rust': { |
|||
\ 'clippy_preference': 'on' |
|||
\ } |
|||
\ } |
|||
|
|||
let g:ale_echo_msg_error_str = 'Err' |
|||
let g:ale_echo_msg_warning_str = 'Warn' |
|||
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' |
|||
|
|||
let g:ale_go_langserver_executable = 'gopls' |
|||
" let g:ale_go_revive_executable = '/usr/bin/revive' |
|||
" let g:ale_go_revive_options = '-config ~/.vim/revive.toml' |
|||
|
|||
let g:airline#extensions#ale#enabled = 1 |
|||
|
|||
let g:ale_completion_enabled = 1 |
|||
let g:ale_lint_on_enter = 0 |
|||
let g:ale_lint_on_text_changed = 'never' |
|||
highlight ALEErrorSign ctermbg=NONE ctermfg=red |
|||
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow |
|||
let g:ale_linters_explicit = 1 |
|||
let g:ale_lint_on_save = 1 |
|||
let g:ale_fix_on_save = 1 |
|||
|
|||
""" vim-go |
|||
let g:go_highlight_types = 1 |
|||
let g:go_highlight_fields = 1 |
|||
let g:go_highlight_functions = 1 |
|||
let g:go_highlight_function_calls = 1 |
|||
|
|||
""" deoplete |
|||
|
|||
" let g:deoplete#sources = {'go': ['deoplete-go'], 'python': ['deoplete-jedi']} |
|||
" call deoplete#custom#option('omni_patterns', { 'go': '[^. *\t]\.\w*' }) |
|||
|
|||
""" Themes and colors |
|||
if exists('+termguicolors') |
|||
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" |
|||
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" |
|||
set termguicolors |
|||
endif |
|||
|
|||
function! LightOrDarkness() |
|||
if &background==?"dark" |
|||
set background=light |
|||
colorscheme edge |
|||
hi Search guibg=Green |
|||
elseif &background==?"light" |
|||
set background=dark |
|||
colorscheme miramare |
|||
hi Search guibg=Purple |
|||
endif |
|||
endfunction |
|||
|
|||
" Needed for kitty not to f*ck up the background color |
|||
let &t_ut='' |
|||
|
|||
set background=dark |
|||
let g:miramare_enable_italic = 0 |
|||
let g:miramare_disable_italic_comment = 1 |
|||
let g:miramare_transparent_background = 0 |
|||
colorscheme miramare |
|||
"let g:airline_theme='hybrid' |
|||
set number |
|||
let g:enable_bold_font = 1 |
|||
let g:enable_italic_font = 1 |
|||
set laststatus=2 |
|||
|
|||
" virtualedit |
|||
"set virtualedit=all |
|||
|
|||
" air-line |
|||
"let g:airline_powerline_fonts = 1 |
|||
|
|||
if !exists('g:airline_symbols') && !g:is_tty |
|||
let g:airline_symbols = {} |
|||
endif |
|||
|
|||
" unicode symbols |
|||
let g:airline_left_sep = '' |
|||
let g:airline_left_alt_sep = '' |
|||
let g:airline_right_sep = '' |
|||
let g:airline_right_alt_sep = '' |
|||
let g:airline_symbols.branch = '' |
|||
let g:airline_symbols.readonly = '' |
|||
let g:airline_symbols.linenr = ''" |
|||
" let g:airline_symbols.branch = '⎇' |
|||
let g:airline_symbols.paste = 'ρ' |
|||
" let g:airline_symbols.paste = 'Þ' |
|||
" let g:airline_symbols.paste = '∥' |
|||
let g:airline_symbols.whitespace = 'Ξ' |
|||
|
|||
|
|||
""" FZF |
|||
|
|||
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"' |
|||
|
|||
let g:fzf_action = { |
|||
\ 'ctrl-t': 'tabedit', |
|||
\ 'ctrl-v': 'vsplit', |
|||
\ 'ctrl-x': 'split' } |
|||
let g:fzf_buffers_jump = 1 |
|||
|
|||
let g:fzf_commands_expect = 'alt-enter,ctrl-x' |
|||
|
|||
" disable popup window |
|||
" let g:fzf_layout = { 'down': '40%' } |
|||
|
|||
""" NERDTree |
|||
|
|||
" Close NERDTree automatically after opening a file with it. |
|||
let g:NERDTreeQuitOnOpen = 1 |
|||
" Use a single click for opening things in NERDTree |
|||
let g:NERDTreeMouseMode = 3 |
|||
let g:NERDTreeMapActivateNode = '<Space>' |
|||
let g:NERDTreeIgnore = [ |
|||
\ '\.pyc$', |
|||
\ '^__pycache__$', |
|||
\ '^\.mypy_cache$', |
|||
\] |
|||
|
|||
" ripgrep |
|||
" if executable('ug') |
|||
" let $FZF_DEFAULT_COMMAND = 'ug' |
|||
" set grepprg=ugrep\ -RInk\ -j\ -u\ --tabs=1\ --ignore-files |
|||
" set grepformat=%f:%l:%c:%m,%f+%l+%c+%m,%-G%f\\\|%l\\\|%c\\\|%m |
|||
" endif |
|||
if executable('rg') |
|||
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"' |
|||
set grepprg=rg\ --vimgrep |
|||
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0) |
|||
endif |
|||
|
|||
" Search in files with ripgrep + preview with bat |
|||
function! Fzf_dev() |
|||
let l:fzf_files_options = '--preview "bat --style=numbers,changes --color always {2..-1} | head -'.&lines.'"' |
|||
|
|||
function! s:files() |
|||
let l:files = split(system($FZF_DEFAULT_COMMAND), '\n') |
|||
return s:format_list(l:files) |
|||
endfunction |
|||
|
|||
function! s:format_list(candidates) |
|||
let l:result = [] |
|||
for l:candidate in a:candidates |
|||
let l:filename = fnamemodify(l:candidate, ':p:t') |
|||
let l:icon = ">-" |
|||
call add(l:result, printf('%s %s', l:icon, l:candidate)) |
|||
endfor |
|||
|
|||
return l:result |
|||
endfunction |
|||
|
|||
function! s:edit_file(item) |
|||
let l:pos = stridx(a:item, ' ') |
|||
let l:file_path = a:item[pos+1:-1] |
|||
execute 'silent e' l:file_path |
|||
endfunction |
|||
|
|||
call fzf#run({ |
|||
\ 'source': <sid>files(), |
|||
\ 'sink': function('s:edit_file'), |
|||
\ 'options': '-m ' . l:fzf_files_options, |
|||
\ 'down': '40%' }) |
|||
endfunction |
|||
""" indentation seek functions |
|||
|
|||
" Jump to the next or previous line that has the same level or a lower |
|||
" level of indentation than the current line. |
|||
" |
|||
" exclusive (bool): true: Motion is exclusive |
|||
" false: Motion is inclusive |
|||
" fwd (bool): true: Go to next line |
|||
" false: Go to previous line |
|||
" lowerlevel (bool): true: Go to line with lower indentation level |
|||
" false: Go to line with the same indentation level |
|||
" skipblanks (bool): true: Skip blank lines |
|||
" false: Don't skip blank lines |
|||
function! NextIndent(exclusive, fwd, lowerlevel, skipblanks) |
|||
let line = line('.') |
|||
let column = col('.') |
|||
let lastline = line('$') |
|||
let indent = indent(line) |
|||
let stepvalue = a:fwd ? 1 : -1 |
|||
while (line > 0 && line <= lastline) |
|||
let line = line + stepvalue |
|||
if ( ! a:lowerlevel && indent(line) == indent || |
|||
\ a:lowerlevel && indent(line) < indent) |
|||
if (! a:skipblanks || strlen(getline(line)) > 0) |
|||
if (a:exclusive) |
|||
let line = line - stepvalue |
|||
endif |
|||
exe line |
|||
exe "normal " column . "|" |
|||
return |
|||
endif |
|||
endif |
|||
endwhile |
|||
endfunction |
|||
|
|||
" Moving back and forth between lines of same or lower indentation. |
|||
nnoremap <silent> [l :call NextIndent(0, 0, 0, 1)<CR> |
|||
nnoremap <silent> ]l :call NextIndent(0, 1, 0, 1)<CR> |
|||
nnoremap <silent> [L :call NextIndent(0, 0, 1, 1)<CR> |
|||
nnoremap <silent> ]L :call NextIndent(0, 1, 1, 1)<CR> |
|||
vnoremap <silent> [l <Esc>:call NextIndent(0, 0, 0, 1)<CR>m'gv'' |
|||
vnoremap <silent> ]l <Esc>:call NextIndent(0, 1, 0, 1)<CR>m'gv'' |
|||
vnoremap <silent> [L <Esc>:call NextIndent(0, 0, 1, 1)<CR>m'gv'' |
|||
vnoremap <silent> ]L <Esc>:call NextIndent(0, 1, 1, 1)<CR>m'gv'' |
|||
onoremap <silent> [l :call NextIndent(0, 0, 0, 1)<CR> |
|||
onoremap <silent> ]l :call NextIndent(0, 1, 0, 1)<CR> |
|||
onoremap <silent> [L :call NextIndent(1, 0, 1, 1)<CR> |
|||
onoremap <silent> ]L :call NextIndent(1, 1, 1, 1)<CR> |
|||
|
|||
""" general |
|||
|
|||
set nospell |
|||
" restore screen after quitting |
|||
" au VimLeave * :!clear |
|||
|
|||
packloadall |
|||
|
|||
silent! helptags ALL |
|||
|
|||
" Enable persistent undo |
|||
set undodir=$VIMHOME/.undo// |
|||
set undofile |
|||
set undolevels=1000 "maximum number of changes that can be undone |
|||
set undoreload=10000 "maximum number lines to save for undo on a buffer reload |
|||
|
|||
" Automatically re-open files after they have changed without prompting. |
|||
" This can be a little more destructive, but a lot less annoying. |
|||
set autoread |
|||
|
|||
set autoindent |
|||
set showmatch |
|||
|
|||
" Put all special files in the right place |
|||
set backupdir=$VIMHOME/.backup// |
|||
set directory=$VIMHOME/.swp// |
|||
|
|||
" Draw tabs and trailing spaces. |
|||
" set listchars=tab:<-> |
|||
let g:indent_guides_enable_on_vim_startup = 1 |
|||
let g:indent_guides_start_level = 2 |
|||
let g:indent_guides_guide_size = 1 |
|||
set listchars=tab:›\ ,trail:•,extends:#,nbsp:. |
|||
"set listchars=tab:-->,trail:$,extends:#,nbsp:. |
|||
hi IndentGuidesOdd ctermbg=white |
|||
hi IndentGuidesEven ctermbg=lightgrey |
|||
set list |
|||
|
|||
" Set the right margin. |
|||
set colorcolumn=89 |
|||
" Automatically split words at the margin. |
|||
" set wrap |
|||
|
|||
" Default to spaces instead of tabs |
|||
set expandtab |
|||
|
|||
" Set tab width to 4. |
|||
set tabstop=4 |
|||
set shiftwidth=4 |
|||
" Setting this will make backspace delete space indents |
|||
set softtabstop=4 |
|||
|
|||
" Disable automatic wrapping. |
|||
set textwidth=0 |
|||
|
|||
" Enable highlight on search patterns matches |
|||
set hlsearch |
|||
hi Search guibg=Purple |
|||
|
|||
" define line highlight color |
|||
highlight LineHighlight ctermbg=darkgray guibg=Purple |
|||
|
|||
|
|||
" Make :Q and :W work like :q and :w |
|||
command! W w |
|||
command! Q q |
|||
command! WQ wq |
|||
command! Wq wq |
|||
command! WW w ! sudo tee %:t |
|||
|
|||
" Make completion smarter. |
|||
set ignorecase |
|||
set smartcase |
|||
|
|||
" viminfo settings |
|||
" '100 : Remember marks for 100 previously edited files. |
|||
" <50 : ??? |
|||
" s10 : ??? |
|||
" h : ??? |
|||
" "100 : Save 100 lines for each register |
|||
" :50 : Remember 50 lines of command history |
|||
set viminfo='100,<50,s10,h,\"100,:50 |
|||
|
|||
" Jump at last opened cursor position position, if valid |
|||
if has("autocmd") |
|||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") |
|||
\| exe "normal! g'\"" | endif |
|||
endif |
|||
|
|||
" Warn about not being able to write to .viminfo, which messes up restoring |
|||
" the cursor position when editing. |
|||
let s:info_filename = expand('~/.viminfo') |
|||
|
|||
if !empty(glob(s:info_filename)) && !filewritable(s:info_filename) |
|||
echoerr 'The .viminfo file cannot be written to!' |
|||
endif |
|||
|
|||
""" powerline |
|||
let g:powerline_pycmd = "py3" |
|||
|
|||
""" keybindings |
|||
|
|||
let mapleader = ',' |
|||
noremap <leader>ad :ALEGoToDefinition<CR> |
|||
nnoremap <leader>af :ALEFix<cr> |
|||
nnoremap <leader>ah :ALEHover<cr> |
|||
noremap <leader>ar :ALEFindReferences<CR> |
|||
nnoremap <leader>r :ALENextWrap<CR> |
|||
nnoremap <leader>R :ALEPreviousWrap<CR> |
|||
nnoremap <silent> <C-d> :bd<CR> |
|||
nnoremap <leader>e :NERDTree<CR> |
|||
nnoremap <leader>r :redo<CR> |
|||
nnoremap <C-h> <C-w><Left> |
|||
nnoremap <C-j> <C-w><Down> |
|||
nnoremap <C-k> <C-w><Up> |
|||
nnoremap <C-l> <C-w><Right> |
|||
nnoremap <leader>b :Gblame<CR> |
|||
nnoremap <C-p> :FZF<CR> |
|||
nnoremap <C-o> :Buffers<CR> |
|||
nnoremap <C-F> :Files<CR> |
|||
nnoremap <C-\> :Rg<CR> |
|||
nnoremap <leader>s :call Fzf_dev()<CR> |
|||
nnoremap <leader>c :Commits<CR> |
|||
nnoremap <leader>b :Gblame<CR> |
|||
nnoremap <leader><esc> :silent! nohls<CR>:call clearmatches()<CR> |
|||
nnoremap <leader><Tab> :bnext<CR> |
|||
nnoremap <leader>\ :bprev<CR> |
|||
nnoremap <Leader>m <Plug>ToggleMarkbar |
|||
nnoremap <Leader>mo <Plug>OpenMarkbar |
|||
nnoremap <Leader>mc <Plug>CloseMarkbar |
|||
nnoremap <Leader>L :call LightOrDarkness()<CR> |
|||
map <Leader>y <Plug>(operator-poweryank-osc52) |
|||
" Following three from here: https://github.com/vim/vim/issues/5157#issue-516033639 |
|||
xnoremap "+y y:call system("wl-copy", @")<cr> |
|||
nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p |
|||
nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p |
|||
nnoremap <Leader>u :UndotreeShow<CR>:UndotreeFocus<CR> |
|||
" highlight the current line |
|||
nnoremap l :call matchadd('LineHighlight', '\%'.line('.').'l')<CR> |
|||
nnoremap <silent> <C-Down> :m .+1<CR>== |
|||
nnoremap <silent> <C-Up> :m .-2<CR>== |
|||
inoremap <silent> <C-Down> <Esc>:m .+1<CR>==gi |
|||
inoremap <silent> <C-Up> <Esc>:m .-2<CR>==gi |
|||
vnoremap <silent> <C-Down> :m '>+1<CR>gv=gv |
|||
vnoremap <silent> <C-Up> :m '<-2<CR>gv=gv |
|||
|
|||
" vim: set et sw=0 ts=4 sts=0: |
Loading…
Reference in new issue