Compare commits

...

31 Commits
master ... rita

Author SHA1 Message Date
blallo 1dbd37b277
Add here powerline plugin 2021-09-06 22:49:53 +02:00
blallo c69a1b829d
Fix python lsp helpers 2021-09-06 22:49:37 +02:00
blallo 54183b69fa
Add python lsp root hint 2021-09-06 22:49:13 +02:00
blallo d2b3076830
(lc) force floating windows 2021-07-21 20:55:55 +02:00
blallo 0079141cf6
Update vim-go 2021-07-21 20:55:37 +02:00
blallo 045f07ae48
Add indentInline 2021-07-21 20:54:58 +02:00
blallo e54c510917
Add redir 2021-07-21 20:51:21 +02:00
blallo eadfba174e
Remove mappings related to markbar 2021-07-21 20:51:16 +02:00
blallo 1b254031fc
Use ALE completion 2021-07-21 20:51:11 +02:00
blallo 07811bd239
Lint SQL 2021-07-21 20:51:06 +02:00
blallo aeaf3ca470
Fix (j|t)sx linting 2021-07-21 20:51:02 +02:00
blallo 22d2a5a00b
Add elixir configs 2021-07-21 20:50:56 +02:00
blallo 2461440c3a
Add plugins (completion and elixir) 2021-07-21 20:50:51 +02:00
blallo 5da8df7b7e
Add ale 2021-06-22 23:05:27 +02:00
blallo 90a23b7842
Fix user_dir 2021-06-22 22:55:50 +02:00
blallo 452b296a5b
Add rust.vim 2021-06-22 22:50:36 +02:00
blallo bb04dd5300
Remap :Buffers 2021-06-22 22:50:21 +02:00
blallo 02051bb50d
Make vim-go work 2021-06-22 22:49:57 +02:00
blallo 03b9070a25
Fix colortheme 2021-06-15 17:15:23 +02:00
blallo d64e9940da
Fix paths 2021-06-15 17:07:01 +02:00
blallo d104fbc8ef
Update archbootstrap.sh 2021-06-15 17:05:51 +02:00
blallo 480c29d0ef
Remove unused configs from vimrc 2021-06-15 16:41:41 +02:00
blallo 68ce86d1ed
Refactor themes 2021-06-15 16:41:16 +02:00
blallo 43b557c76b
Add ekalinin/Dockerfile.vim 2021-06-15 16:40:22 +02:00
blallo 579823514f
Add cespare/vim-toml 2021-06-15 16:39:51 +02:00
blallo 5215d0f1af
Add fatih/vim-go 2021-06-15 16:39:01 +02:00
blallo 84c1fc4e6e
Add mucomplete config 2021-06-15 16:27:38 +02:00
blallo 09a7e959fd
Tidy 2021-06-15 16:26:37 +02:00
blallo eb683ef97e
Add most packages 2021-06-15 16:24:08 +02:00
blallo 8111516a70
Init vim 8 native packages as submodules 2021-06-11 22:56:18 +02:00
blallo 64edc2c7c1
Refactor vimrc 2021-06-11 22:55:32 +02:00
57 changed files with 923 additions and 522 deletions

103
.gitmodules vendored 100644
View File

@ -0,0 +1,103 @@
[submodule "pack/vendor/start/fzf"]
path = pack/vendor/start/fzf
url = https://github.com/junegunn/fzf
[submodule "pack/vendor/start/fzf.vim"]
path = pack/vendor/start/fzf.vim
url = https://github.com/junegunn/fzf.vim
[submodule "pack/vendor/start/vim-poweryank"]
path = pack/vendor/start/vim-poweryank
url = https://github.com/haya14busa/vim-poweryank
[submodule "pack/vendor/start/undotree"]
path = pack/vendor/start/undotree
url = https://github.com/mbbill/undotree
[submodule "pack/vendor/start/powerline"]
path = pack/vendor/start/powerline
url = https://github.com/powerline/powerline
[submodule "pack/vendor/start/vim-fetch"]
path = pack/vendor/start/vim-fetch
url = https://github.com/wsdjeg/vim-fetch
[submodule "pack/vendor/start/vim-eunuch"]
path = pack/vendor/start/vim-eunuch
url = https://github.com/tpope/vim-eunuch
[submodule "pack/vendor/start/vim-commentary"]
path = pack/vendor/start/vim-commentary
url = https://github.com/tpope/vim-commentary
[submodule "pack/vendor/start/vim-rooter"]
path = pack/vendor/start/vim-rooter
url = https://github.com/airblade/vim-rooter
[submodule "pack/vendor/start/nerdtree"]
path = pack/vendor/start/nerdtree
url = https://github.com/scrooloose/nerdtree
[submodule "pack/vendor/start/vim-mucomplete"]
path = pack/vendor/start/vim-mucomplete
url = https://github.com/lifepillar/vim-mucomplete
[submodule "pack/vendor/start/nerdtree-git-plugin"]
path = pack/vendor/start/nerdtree-git-plugin
url = https://github.com/Xuyuanp/nerdtree-git-plugin
[submodule "pack/vendor/start/vim-fugitive"]
path = pack/vendor/start/vim-fugitive
url = https://github.com/tpope/vim-fugitive
[submodule "LanguageClient-neovim"]
path = pack/vendor/start/LanguageClient-neovim
url = https://github.com/autozimu/LanguageClient-neovim
branch = next
[submodule "pack/vendor/start/miramare"]
path = pack/vendor/start/miramare
url = https://github.com/franbach/miramare
[submodule "pack/vendor/start/vim-gitgo"]
path = pack/vendor/start/vim-gitgo
url = https://github.com/bitfield/vim-gitgo
[submodule "pack/vendor/start/melange"]
path = pack/vendor/start/melange
url = https://github.com/savq/melange
[submodule "pack/vendor/start/vim-indent-guides"]
path = pack/vendor/start/vim-indent-guides
url = https://github.com/nathanaelkane/vim-indent-guides
[submodule "pack/vendor/start/auto-pairs"]
path = pack/vendor/start/auto-pairs
url = https://github.com/jiangmiao/auto-pairs
[submodule "pack/vendor/start/black"]
path = pack/vendor/start/black
url = https://github.com/ambv/black
[submodule "pack/vendor/start/yaml-vim"]
path = pack/vendor/start/yaml-vim
url = https://github.com/mrk21/yaml-vim
[submodule "pack/vendor/start/vim-go"]
path = pack/vendor/start/vim-go
url = https://github.com/fatih/vim-go
[submodule "pack/vendor/start/vim-toml"]
path = pack/vendor/start/vim-toml
url = https://github.com/cespare/vim-toml
[submodule "pack/vendor/start/Dockerfile.vim"]
path = pack/vendor/start/Dockerfile.vim
url = https://github.com/ekalinin/Dockerfile.vim
[submodule "pack/vendor/start/rust.vim"]
path = pack/vendor/start/rust.vim
url = https://github.com/rust-lang/rust.vim
[submodule "pack/vendor/start/ale"]
path = pack/vendor/start/ale
url = https://github.com/dense-analysis/ale
[submodule "pack/vendor/start/deoplete.nvim"]
path = pack/vendor/start/deoplete.nvim
url = https://github.com/Shougo/deoplete.nvim
[submodule "pack/vendor/start/nvim-yarp"]
path = pack/vendor/start/nvim-yarp
url = https://github.com/roxma/nvim-yarp
[submodule "pack/vendor/start/vim-hug-neovim-rpc"]
path = pack/vendor/start/vim-hug-neovim-rpc
url = https://github.com/roxma/vim-hug-neovim-rpc
[submodule "pack/vendor/start/deoplete-go"]
path = pack/vendor/start/deoplete-go
url = https://github.com/deoplete-plugins/deoplete-go
[submodule "pack/vendor/start/deoplete-jedi"]
path = pack/vendor/start/deoplete-jedi
url = https://github.com/deoplete-plugins/deoplete-jedi
[submodule "pack/vendor/start/vim-elixirls"]
path = pack/vendor/start/vim-elixirls
url = https://github.com/GrzegorzKozub/vim-elixirls
[submodule "pack/vendor/start/vim-elixir"]
path = pack/vendor/start/vim-elixir
url = https://github.com/elixir-editors/vim-elixir
[submodule "pack/vendor/start/indentLine"]
path = pack/vendor/start/indentLine
url = https://github.com/Yggdroot/indentLine

View File

@ -11,3 +11,12 @@ sudo pacman -Sy \
python-greenlet
pip3 install --user pynvim
mkdir .{swp,backup,undo}
git submodule update --init
THISDIR=$PWD
cd pack/vendor/start/LanguageClient-neovim
bash install.sh
cd $THISDIR

22
config/airline.vim 100644
View File

@ -0,0 +1,22 @@
" 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 = 'Ξ'

104
config/ale.vim 100644
View File

@ -0,0 +1,104 @@
""" ALE configuration
let s:user_dir = has('win32') ? expand('~/vimfiles') : expand('~/.vim')
let g:ale_completion_enabled = 0
let g:ale_sign_error = '->'
let g:ale_sign_warning = '~>'
" let g:ale_sign_error = '✘'
" let g:ale_sign_warning = '⚠'
let g:ale_elixir_elixir_ls_release = s:user_dir . './pack/vendor/start/vim-elixirls/elixir-ls/release'
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'javascriptreact': ['eslint'],
\ 'typescript': ['deno', 'tsserver', 'tslint'],
\ 'typescriptreact': ['deno', 'tsserver', 'tslint'],
\ 'python': ['pyls', 'pylint'],
\ 'rust': ['rls'],
\ 'elixir': ['credo', 'elixir-ls'],
\ 'go': ['gopls'],
\ 'json': ['jsonlint'],
\ 'dockerfile': ['hadolint'],
\ 'vala': ['vala-language-server'],
\ 'scss': ['eslint'],
\ 'elm': ['elm_ls'],
\ 'sql': ['sql-lint'],
\}
let g:ale_fixers = {
\ 'javascript': ['prettier'],
\ 'typescript': ['prettier'],
\ 'javascriptreact': ['prettier'],
\ 'typescriptreact': ['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
packloadall
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
" let g:ale_set_balloons = 1
let g:ale_hover_to_preview = 1
let g:ale_float_preview = 1
let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰']
set omnifunc=ale#completion#OmniFunc

View File

@ -0,0 +1,5 @@
""" deoplete
let g:deoplete#enable_at_startup = 1
" let g:deoplete#sources = {'go': ['deoplete-go'], 'python': ['deoplete-jedi']}
" call deoplete#custom#option('omni_patterns', { 'go': '[^. *\t]\.\w*' })

15
config/fzf.vim 100644
View File

@ -0,0 +1,15 @@
""" 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%' }

49
config/indent.vim 100644
View File

@ -0,0 +1,49 @@
""" 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>

View File

@ -0,0 +1,36 @@
""" 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 s:user_dir = has('win32') ? expand('~/vimfiles') : expand('~/.vim')
let g:LanguageClient_serverCommands = {
\ 'rust': ['/usr/bin/rustup', 'run', 'stable', 'rls'],
\ 'elixir': [ s:user_dir . '/pack/vendor/start/vim-elixirls/elixir-ls/release/language_server.sh'],
\ 'elm': ['/usr/bin/elm-language-server'],
\ 'python': ['/usr/bin/pyls'],
\ 'go': ['/usr/bin/gopls'],
\ }
let g:LanguageClient_rootMarkers = {
\ 'elm': ['elm.json'],
\ 'elixir': ['mix.exs'],
\ 'python': ['setup.py'],
\ }
let g:LanguageClient_hoverPreview = 'always'
" 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)

View File

@ -0,0 +1,6 @@
set completeopt+=menuone
set completeopt+=noselect
" set completeopt+=noinsert
set shortmess+=c " Shut off completion messages
set belloff+=ctrlg " If Vim beeps during completion
let g:mucomplete#enable_auto_at_startup = 1

View File

@ -0,0 +1,22 @@
""" 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

View File

@ -0,0 +1,13 @@
""" 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$',
\]

168
config/plug.vim 100644
View File

@ -0,0 +1,168 @@
" 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
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'
" 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'
" 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()

View File

@ -0,0 +1,2 @@
""" powerline
let g:powerline_pycmd = "py3"

30
config/redir.vim 100644
View File

@ -0,0 +1,30 @@
function! Redir(cmd, rng, start, end)
for win in range(1, winnr('$'))
if getwinvar(win, 'scratch')
execute win . 'windo close'
endif
endfor
if a:cmd =~ '^!'
let cmd = a:cmd =~' %'
\ ? matchstr(substitute(a:cmd, ' %', ' ' . expand('%:p'), ''), '^!\zs.*')
\ : matchstr(a:cmd, '^!\zs.*')
if a:rng == 0
let output = systemlist(cmd)
else
let joined_lines = join(getline(a:start, a:end), '\n')
let cleaned_lines = substitute(shellescape(joined_lines), "'\\\\''", "\\\\'", 'g')
let output = systemlist(cmd . " <<< $" . cleaned_lines)
endif
else
redir => output
execute a:cmd
redir END
let output = split(output, "\n")
endif
vnew
let w:scratch = 1
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
call setline(1, output)
endfunction
command! -nargs=1 -complete=command -bar -range Redir silent call Redir(<q-args>, <range>, <line1>, <line2>)

44
config/rg.vim 100644
View File

@ -0,0 +1,44 @@
" 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

28
config/theme.vim 100644
View File

@ -0,0 +1,28 @@
""" 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
" source $VIMHOME/config/themes/melange.vim
source $VIMHOME/config/themes/miramare.vim
function! LightOrDarkness()
if &background==?"dark"
set background=light
colorscheme gitgo
hi Search guibg=Green
elseif &background==?"light"
set background=dark
execute 'colorscheme ' . g:colorscheme
hi Search guibg=Purple
endif
endfunction
" Needed for kitty not to f*ck up the background color
let &t_ut=''
" virtualedit
"set virtualedit=all

View File

@ -0,0 +1,4 @@
" Melange configuration
colorscheme melange
let g:colorscheme = 'melange'

View File

@ -0,0 +1,13 @@
" Miramare config
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
let g:colorscheme = 'miramare'

View File

@ -0,0 +1,8 @@
""" 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
let g:go_imports_autosave = 0
let g:go_doc_popup_window = 1

View File

@ -0,0 +1,4 @@
""" vim-rooter
"let g:rooter_change_directory_for_non_project_files = 'current':

View File

@ -32,12 +32,16 @@ function! ChangePythonLineLength() abort
let &l:colorcolumn = l:line_length + 1
endfunction
" call ChangePythonLineLength()
call ChangePythonLineLength()
let b:ale_linters = ['flake8', 'mypy']
let b:ale_linters = [
"\ 'flake8',
\ 'mypy',
\ 'pyls',
\]
let b:ale_fixers = [
\ 'autopep8',
\ 'yapf',
"\ 'autopep8',
"\ 'yapf',
\ 'black',
\]
let b:ale_completion_excluded_words = ['and', 'or', 'if']

@ -0,0 +1 @@
Subproject commit 86d744c6e4731d0014ef469f019a305e2d7baac0

@ -0,0 +1 @@
Subproject commit a42594c9c320b1283e9b9058b85a8097d8325fed

1
pack/vendor/start/ale vendored 160000

@ -0,0 +1 @@
Subproject commit a4ba421803d030a8967ede111ce921d439aa5fbb

1
pack/vendor/start/auto-pairs vendored 160000

@ -0,0 +1 @@
Subproject commit 39f06b873a8449af8ff6a3eee716d3da14d63a76

1
pack/vendor/start/black vendored 160000

@ -0,0 +1 @@
Subproject commit bd7f49df3e16b52f0b287c28427c306e6c1064c8

1
pack/vendor/start/deoplete-go vendored 160000

@ -0,0 +1 @@
Subproject commit 4eac2e6f127f2e2601dee415db2f826e2c9ef16c

@ -0,0 +1 @@
Subproject commit 43058915007d92dc167b84dd5b8ada2d2a057a82

@ -0,0 +1 @@
Subproject commit 6fc33bed8f5c75a08b14af285d7775d893037cc4

1
pack/vendor/start/fzf vendored 160000

@ -0,0 +1 @@
Subproject commit 7191ebb615f5d6ebbf51d598d8ec853a65e2274d

1
pack/vendor/start/fzf.vim vendored 160000

@ -0,0 +1 @@
Subproject commit e34f6c129d39b90db44df1107c8b7dfacfd18946

1
pack/vendor/start/indentLine vendored 160000

@ -0,0 +1 @@
Subproject commit 5617a1cf7d315e6e6f84d825c85e3b669d220bfa

1
pack/vendor/start/melange vendored 160000

@ -0,0 +1 @@
Subproject commit a43de4787b38876f84281fcc7cdc26250a26aa15

1
pack/vendor/start/miramare vendored 160000

@ -0,0 +1 @@
Subproject commit ec1b7cfa60af4fce88a947bdfc2d81a6b6e85ca4

1
pack/vendor/start/nerdtree vendored 160000

@ -0,0 +1 @@
Subproject commit 81f3eaba295b3fceb2d032db57e5eae99ae480f8

@ -0,0 +1 @@
Subproject commit bca0ed63883d028e6afc7f11a78c56fcaf34d363

1
pack/vendor/start/nvim-yarp vendored 160000

@ -0,0 +1 @@
Subproject commit b710bf4daccb603a423754794fb446e5fbb59576

1
pack/vendor/start/powerline vendored 160000

@ -0,0 +1 @@
Subproject commit 7310d53adef5ba5829712b1ac06839be1b4852b9

1
pack/vendor/start/rust.vim vendored 160000

@ -0,0 +1 @@
Subproject commit 87c745d8d506fc1eecc1d81df15d5bde1658a2fc

1
pack/vendor/start/undotree vendored 160000

@ -0,0 +1 @@
Subproject commit 1cc3b9069e4356efd4ce1c3c4bdbb227fb54e1e5

@ -0,0 +1 @@
Subproject commit 349340debb34f6302931f0eb7139b2c11dfdf427

1
pack/vendor/start/vim-elixir vendored 160000

@ -0,0 +1 @@
Subproject commit 58084475c1e523caeac97ffff62c154f7f8fcc66

1
pack/vendor/start/vim-elixirls vendored 160000

@ -0,0 +1 @@
Subproject commit 346938e2ce87aaa5b3b5ccd9cb8336da8ab967b9

1
pack/vendor/start/vim-eunuch vendored 160000

@ -0,0 +1 @@
Subproject commit dbbbf853fc523d312f61b4bbdf2e13297645dcde

1
pack/vendor/start/vim-fetch vendored 160000

@ -0,0 +1 @@
Subproject commit 0a6ab17e84c7f4808bf05ec380121bce40b40d21

1
pack/vendor/start/vim-fugitive vendored 160000

@ -0,0 +1 @@
Subproject commit be9ff95f27d12b7bd46ab5d36f7149cb0864c329

1
pack/vendor/start/vim-gitgo vendored 160000

@ -0,0 +1 @@
Subproject commit c30d1c3f6da0a43c4ef6eb18b47e42be828e6eae

1
pack/vendor/start/vim-go vendored 160000

@ -0,0 +1 @@
Subproject commit 32bcf757e455ab3b87c9201247b9a6b091d44ea0

@ -0,0 +1 @@
Subproject commit 93ae38792bc197c3bdffa2716ae493c67a5e7957

@ -0,0 +1 @@
Subproject commit 54d889a63716ee2f1818aa2ec5082db47147147b

@ -0,0 +1 @@
Subproject commit 83cd9b3775438faafc3475f9f9d5fbb8da4dfa5b

@ -0,0 +1 @@
Subproject commit 48dff95dbd64423c96fdae5c18eaddb5b5fa3064

1
pack/vendor/start/vim-rooter vendored 160000

@ -0,0 +1 @@
Subproject commit 9a5ce8edc67cca36cc530ee27a805112ce7a7e9b

1
pack/vendor/start/vim-toml vendored 160000

@ -0,0 +1 @@
Subproject commit 3c5face8e8944a217af45bc5bb708ff7dfcf1a54

1
pack/vendor/start/yaml-vim vendored 160000

@ -0,0 +1 @@
Subproject commit 509eef523082d69a75652739d4e7e6068eeb6506

View File

@ -0,0 +1,169 @@
if exists('g:powerline_loaded')
finish
endif
let g:powerline_loaded = 1
if exists('g:powerline_pycmd')
let s:pycmd = substitute(g:powerline_pycmd, '\v\C^(py)%[thon](3?)$', '\1\2', '')
if s:pycmd is# 'py'
let s:has_python = has('python')
let s:pyeval = get(g:, 'powerline_pyeval', 'pyeval')
elseif s:pycmd is# 'py3'
let s:has_python = has('python3')
let s:pyeval = 'py3eval'
let s:pyeval = get(g:, 'powerline_pyeval', 'py3eval')
else
if !exists('g:powerline_pyeval')
echohl ErrorMsg
echomsg 'g:powerline_pycmd was set to an unknown values, but g:powerline_pyeval'
echomsg 'was not set. You should either set g:powerline_pycmd to "py3" or "py",'
echomsg 'specify g:powerline_pyeval explicitly or unset both and let powerline'
echomsg 'figure them out.'
echohl None
unlet s:pycmd
finish
endif
let s:pyeval = g:powerline_pyeval
let s:has_python = 1
endif
elseif has('python3')
let s:has_python = 1
let s:pycmd = 'py3'
let s:pyeval = get(g:, 'powerline_pyeval', 'py3eval')
elseif has('python')
let s:has_python = 1
let s:pycmd = 'py'
let s:pyeval = get(g:, 'powerline_pyeval', 'pyeval')
else
let s:has_python = 0
endif
if !s:has_python
if !exists('g:powerline_no_python_error')
echohl ErrorMsg
echomsg 'You need vim compiled with Python 2.6, 2.7 or 3.2 and later support'
echomsg 'for Powerline to work. Please consult the documentation for more'
echomsg 'details.'
echohl None
endif
unlet s:has_python
finish
endif
unlet s:has_python
let s:import_cmd = 'from powerline.vim import VimPowerline'
function s:rcmd(s)
if !exists('s:pystr')
let s:pystr = a:s . "\n"
else
let s:pystr = s:pystr . a:s . "\n"
endif
endfunction
try
let s:can_replace_pyeval = !exists('g:powerline_pyeval')
call s:rcmd('try:')
call s:rcmd(' powerline_appended_path = None')
call s:rcmd(' try:')
call s:rcmd(' '.s:import_cmd.'')
call s:rcmd(' except ImportError:')
call s:rcmd(' import sys, vim')
call s:rcmd(' powerline_appended_path = vim.eval("expand(\"<sfile>:h:h:h:h:h\")")')
call s:rcmd(' sys.path.append(powerline_appended_path)')
call s:rcmd(' '.s:import_cmd.'')
call s:rcmd(' import vim')
call s:rcmd(' powerline_instance = VimPowerline()')
call s:rcmd(' powerline_instance.setup(pyeval=vim.eval("s:pyeval"), pycmd=vim.eval("s:pycmd"), can_replace_pyeval=int(vim.eval("s:can_replace_pyeval")))')
call s:rcmd(' del VimPowerline')
call s:rcmd(' del powerline_instance')
call s:rcmd('except Exception:')
call s:rcmd(' import traceback, sys')
call s:rcmd(' traceback.print_exc(file=sys.stdout)')
call s:rcmd(' raise')
execute s:pycmd s:pystr
unlet s:pystr
let s:launched = 1
finally
unlet s:can_replace_pyeval
unlet s:import_cmd
if !exists('s:launched')
unlet s:pystr
echohl ErrorMsg
echomsg 'An error occurred while importing powerline module.'
echomsg 'This could be caused by invalid sys.path setting,'
echomsg 'or by an incompatible Python version (powerline requires'
echomsg 'Python 2.6, 2.7 or 3.2 and later to work). Please consult'
echomsg 'the troubleshooting section in the documentation for'
echomsg 'possible solutions.'
if s:pycmd is# 'py' && has('python3')
echomsg 'If powerline on your system is installed for python 3 only you'
echomsg 'should set g:powerline_pycmd to "py3" to make it load correctly.'
endif
echohl None
call s:rcmd('def powerline_troubleshoot():')
call s:rcmd(' import sys')
call s:rcmd(' import vim')
call s:rcmd(' if sys.version_info < (2, 6):')
call s:rcmd(' print("Too old python version: " + sys.version + " (first supported is 2.6)")')
call s:rcmd(' elif sys.version_info[0] == 3 and sys.version_info[1] < 2:')
call s:rcmd(' print("Too old python 3 version: " + sys.version + " (first supported is 3.2)")')
call s:rcmd(' try:')
call s:rcmd(' import powerline')
call s:rcmd(' except ImportError:')
call s:rcmd(' print("Unable to import powerline, is it installed?")')
call s:rcmd(' else:')
call s:rcmd(' if not vim.eval(''expand("<sfile>")'').startswith("/usr/"):')
call s:rcmd(' import os')
call s:rcmd(' powerline_dir = os.path.realpath(os.path.normpath(powerline.__file__))')
call s:rcmd(' powerline_dir = os.path.dirname(powerline.__file__)')
call s:rcmd(' this_dir = os.path.realpath(os.path.normpath(vim.eval(''expand("<sfile>:p")'')))')
call s:rcmd(' this_dir = os.path.dirname(this_dir)') " powerline/bindings/vim/plugin
call s:rcmd(' this_dir = os.path.dirname(this_dir)') " powerline/bindings/vim
call s:rcmd(' this_dir = os.path.dirname(this_dir)') " powerline/bindings
call s:rcmd(' this_dir = os.path.dirname(this_dir)') " powerline
call s:rcmd(' if os.path.basename(this_dir) != "powerline":')
call s:rcmd(' print("Check your installation:")')
call s:rcmd(' print("this script is not in powerline[/bindings/vim/plugin] directory,")')
call s:rcmd(' print("neither it is installed system-wide")')
call s:rcmd(' real_powerline_dir = os.path.realpath(powerline_dir)')
call s:rcmd(' real_this_dir = os.path.realpath(this_dir)')
call s:rcmd(' this_dir_par = os.path.dirname(real_this_dir)')
call s:rcmd(' powerline_appended_path = globals().get("powerline_appended_path")')
call s:rcmd(' if powerline_appended_path is not None and this_dir_par != powerline_appended_path:')
call s:rcmd(' print("Check your installation: this script is symlinked somewhere")')
call s:rcmd(' print("where powerline is not present: {0!r} != {1!r}.".format(')
call s:rcmd(' real_this_dir, powerline_appended_path))')
call s:rcmd(' elif real_powerline_dir != real_this_dir:')
call s:rcmd(' print("It appears that you have two powerline versions installed:")')
call s:rcmd(' print("one in " + real_powerline_dir + ", other in " + real_this_dir + ".")')
call s:rcmd(' print("You should remove one of this. Check out troubleshooting section,")')
call s:rcmd(' print("it contains some information about the alternatives.")')
call s:rcmd(' try:')
call s:rcmd(' from powerline.lint import check')
call s:rcmd(' except ImportError:')
call s:rcmd(' print("Failed to import powerline.lint.check, cannot run powerline-lint")')
call s:rcmd(' else:')
call s:rcmd(' try:')
call s:rcmd(' paths = powerline_instance.get_config_paths()')
call s:rcmd(' except NameError:')
call s:rcmd(' pass')
call s:rcmd(' else:')
call s:rcmd(' from powerline.lint.markedjson.error import echoerr')
call s:rcmd(' ee = lambda *args, **kwargs: echoerr(*args, stream=sys.stdout, **kwargs)')
call s:rcmd(' check(paths=paths, echoerr=ee, require_ext="vim")')
call s:rcmd('try:')
call s:rcmd(' powerline_troubleshoot()')
call s:rcmd('finally:')
call s:rcmd(' del powerline_troubleshoot')
execute s:pycmd s:pystr
unlet s:pystr
unlet s:pycmd
unlet s:pyeval
delfunction s:rcmd
finish
else
unlet s:launched
endif
unlet s:pycmd
unlet s:pyeval
delfunction s:rcmd
endtry

545
vimrc
View File

@ -3,536 +3,47 @@ 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 = '⚠'
" set user_dir
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/'
""" Set python3 path
let g:python3_host_prog = "/usr/bin/python"
let g:python_host_prog='/usr/bin/python'
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'],
\}
""" source
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>
" all other includes are in alphabetical order
source $VIMHOME/config/ale.vim
source $VIMHOME/config/fzf.vim
source $VIMHOME/config/indent.vim
source $VIMHOME/config/language-client.vim
source $VIMHOME/config/mucomplete.vim
source $VIMHOME/config/nerdtree.vim
source $VIMHOME/config/powerline.vim
source $VIMHOME/config/redir.vim
source $VIMHOME/config/rg.vim
source $VIMHOME/config/theme.vim " this sets the colorscheme
source $VIMHOME/config/vim-go.vim
source $VIMHOME/config/vim-rooter.vim
""" general
filetype plugin indent on
set nospell
" restore screen after quitting
" au VimLeave * :!clear
syntax on
packloadall
silent! helptags ALL
" Enable persistent undo
set undodir=$VIMHOME/.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
@ -545,8 +56,8 @@ set autoindent
set showmatch
" Put all special files in the right place
set backupdir=$VIMHOME/.backup//
set directory=$VIMHOME/.swp//
set backupdir=$VIMHOME/.backup/
set directory=$VIMHOME/.swp/
" Draw tabs and trailing spaces.
" set listchars=tab:<->
@ -587,8 +98,11 @@ highlight LineHighlight ctermbg=darkgray guibg=Purple
" Make :Q and :W work like :q and :w
command! W w
command! Q q
command! QA qa
command! WQ wq
command! Wq wq
command! Wqa wqa
command! WQA wqa
command! WW w ! sudo tee %:t
" Make completion smarter.
@ -618,8 +132,6 @@ 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
@ -639,7 +151,7 @@ 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 <leader>f :Buffers<CR>
nnoremap <C-F> :Files<CR>
nnoremap <C-\> :Rg<CR>
nnoremap <leader>s :call Fzf_dev()<CR>
@ -648,9 +160,6 @@ 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