├── .github └── workflows │ └── closepr.yml ├── .gitignore ├── .gitmodules ├── GNUmakefile ├── README ├── ftplugin ├── eruby.vim ├── markdown.vim ├── ruby.vim └── svelte.vim ├── plugin ├── coding │ ├── editorconfig-vim.vim │ └── vim-polyglot.vim ├── lsp │ ├── ale.vim │ └── vim-lsp.vim └── shell │ ├── fzf.vim │ └── nerdtree.vim ├── undodir └── .gitignore └── vimrc /.github/workflows/closepr.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Close PR 3 | 4 | on: 5 | pull_request_target: 6 | types: [opened] 7 | 8 | jobs: 9 | run: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | issues: write 13 | pull-requests: write 14 | steps: 15 | - uses: actions/github-script@v7 16 | with: 17 | script: | 18 | github.rest.issues.createComment({ 19 | owner: context.repo.owner, 20 | repo: context.repo.repo, 21 | issue_number: context.issue_number, 22 | body: "Due to GDPR policies, pull requests cannot be accepted currently. Sorry.", 23 | }) 24 | github.rest.issues.update({ 25 | owner: context.repo.owner, 26 | repo: context.repo.repo, 27 | issue_number: context.issue.number, 28 | state: 'closed', 29 | state_reason: 'not_planned', 30 | }) 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .netrwhist 2 | bookmarks 3 | info 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pack/coding/start/editorconfig-vim"] 2 | path = pack/coding/start/editorconfig-vim 3 | url = https://github.com/editorconfig/editorconfig-vim 4 | [submodule "pack/coding/start/vim-polyglot"] 5 | path = pack/coding/start/vim-polyglot 6 | url = https://github.com/sheerun/vim-polyglot 7 | [submodule "pack/lsp/start/ale"] 8 | path = pack/lsp/start/ale 9 | url = https://github.com/w0rp/ale 10 | [submodule "pack/lsp/start/asyncomplete"] 11 | path = pack/lsp/start/asyncomplete 12 | url = https://github.com/prabirshrestha/asyncomplete.vim 13 | [submodule "pack/lsp/start/asyncomplete-lsp"] 14 | path = pack/lsp/start/asyncomplete-lsp 15 | url = https://github.com/prabirshrestha/asyncomplete-lsp.vim 16 | [submodule "pack/lsp/start/vim-lsp"] 17 | path = pack/lsp/start/vim-lsp 18 | url = https://github.com/prabirshrestha/vim-lsp 19 | [submodule "pack/shell/start/nerdtree"] 20 | path = pack/shell/start/nerdtree 21 | url = https://github.com/preservim/nerdtree 22 | [submodule "pack/shell/start/fzf"] 23 | path = pack/shell/start/fzf 24 | url = https://github.com/junegunn/fzf 25 | [submodule "pack/shell/start/fzf-vim"] 26 | path = pack/shell/start/fzf-vim 27 | url = https://github.com/junegunn/fzf.vim 28 | [submodule "pack/lsp/start/vim-lsp-settings"] 29 | path = pack/lsp/start/vim-lsp-settings 30 | url = https://github.com/danirod/vim-lsp-settings 31 | branch = jdtls-refresh-pattern 32 | -------------------------------------------------------------------------------- /GNUmakefile: -------------------------------------------------------------------------------- 1 | .PHONY: info fetch-packs update-packs 2 | 3 | ## make info :: prints help 4 | info: 5 | @grep '^## make' < GNUmakefile | tr -d '#' | sort 6 | 7 | ## make fetch-packs :: pulls packs 8 | fetch-packs: 9 | git submodule init 10 | git submodule update 11 | 12 | ## make update-packs :: updates the plugins 13 | update-packs: 14 | git submodule update --remote 15 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is my vimrc, the configuration file for my Vim distribution. Currently, my 2 | vimrc is more frugal and boring that what it used to be. 3 | 4 | Plugins are installed as regular packs and tracked by Git submodule. The 5 | provided GNUmakefile is used to fetch and update the packs. 6 | 7 | The online backup is hosted at https://git.danirod.es/dotfiles/vimrc. There is 8 | a GitHub mirror, but it is read only. Please, do not send GitHub pull requests. 9 | They cannot be accepted due to a GDPR policy and they will be closed 10 | automatically. 11 | -------------------------------------------------------------------------------- /ftplugin/eruby.vim: -------------------------------------------------------------------------------- 1 | setlocal nocursorline 2 | setlocal regexpengine=1 3 | -------------------------------------------------------------------------------- /ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | set breakindent 2 | set wrap 3 | set linebreak 4 | -------------------------------------------------------------------------------- /ftplugin/ruby.vim: -------------------------------------------------------------------------------- 1 | " Disable ALE unless saving 2 | let ale_lint_on_text_changed = 'never' 3 | let ale_lint_on_insert_leave = 0 4 | let ale_lint_on_enter = 0 5 | 6 | " Optimizations required if you plan on open Ruby files. 7 | setglobal regexpengine=1 8 | setglobal ttyfast 9 | -------------------------------------------------------------------------------- /ftplugin/svelte.vim: -------------------------------------------------------------------------------- 1 | " It seems that Svelte is one of those languages that become slow in Vim 2 | " as more files are opened at the same time. Setup the regexpengine to 1. 3 | setlocal nocursorline 4 | setlocal regexpengine=1 5 | -------------------------------------------------------------------------------- /plugin/coding/editorconfig-vim.vim: -------------------------------------------------------------------------------- 1 | let g:EditorConfig_exclude_patterns = ['fugitive://.\*', 'scp://.\*'] 2 | -------------------------------------------------------------------------------- /plugin/coding/vim-polyglot.vim: -------------------------------------------------------------------------------- 1 | " javascript 2 | let g:javascript_plugin_jsdoc = 1 3 | 4 | " markdown 5 | let g:vim_markdown_frontmatter = 1 6 | 7 | " ruby 8 | let ruby_no_expensive = 1 9 | 10 | " vue 11 | let g:vue_disable_pre_processors = 1 12 | 13 | " svelte 14 | let g:vim_svelte_plugin_use_typescript = 1 15 | let g:vim_svelte_plugin_use_sass = 1 16 | -------------------------------------------------------------------------------- /plugin/lsp/ale.vim: -------------------------------------------------------------------------------- 1 | let g:ale_fix_on_save = 1 2 | 3 | function s:danirod_save_without_format() 4 | let g:ale_fix_on_save = 0 5 | write 6 | let g:ale_fix_on_save = 1 7 | endfunction 8 | 9 | command! ALESaveWithoutFormat :call s:danirod_save_without_format() 10 | 11 | let g:ale_linters = { 12 | \ 'c': ['clang'], 13 | \ 'cpp': ['clang'], 14 | \ 'go': ['gopls', 'gofmt'], 15 | \ 'h': ['clang'], 16 | \ 'java': ['javac'], 17 | \ 'javascript': ['eslint'], 18 | \ 'python': ['pylint', 'flake8'], 19 | \ 'typescript': ['prettier'], 20 | \ 'ruby': ['rubocop'], 21 | \ 'rust': ['rustfmt'], 22 | \ 'vue': ['eslint', 'stylelint', 'vls'], 23 | \ 'vuejs': ['eslint', 'stylelint', 'vls'], 24 | \ 'svelte': ['eslint'], 25 | \ } 26 | let g:ale_fixers = { 27 | \ 'c': ['clang-format'], 28 | \ 'cpp': ['clang-format'], 29 | \ 'go': ['gofmt', 'goimports'], 30 | \ 'h': ['clang-format'], 31 | \ 'java': ['clang-format'], 32 | \ 'javascript': ['prettier', 'eslint'], 33 | \ 'python': ['black'], 34 | \ 'typescript': ['prettier', 'eslint', 'tslint'], 35 | \ 'ruby': ['rubocop'], 36 | \ 'rust': ['rustfmt'], 37 | \ 'vue': ['prettier'], 38 | \ 'vuejs': ['prettier'], 39 | \ 'svelte': ['prettier'], 40 | \ } 41 | 42 | if isdirectory('/usr/local/llvm12') 43 | let g:ale_c_clangd_executable = '/usr/local/bin/clang-format12' 44 | let g:ale_c_clangformat_executable = '/usr/local/bin/clang-format12' 45 | endif 46 | -------------------------------------------------------------------------------- /plugin/lsp/vim-lsp.vim: -------------------------------------------------------------------------------- 1 | let g:lsp_diagnostics_enabled = 1 2 | let g:lsp_diagnostics_echo_cursor = 1 3 | let g:lsp_diagnostics_float_cursor = 1 4 | 5 | let g:lsp_completion_documentation_enabled = 1 6 | let g:lsp_completion_documentation_delay = 1000 7 | 8 | " Move notification messages to the right 9 | let g:lsp_diagnostics_virtual_text_enabled=0 10 | 11 | " Gutter symbols 12 | let g:lsp_document_code_action_signs_enabled = 1 13 | let g:lsp_document_code_action_signs_hint = {'text': '→'} 14 | let g:lsp_diagnostics_signs_error = {'text': '⨉'} 15 | let g:lsp_diagnostics_signs_warning = {'text': '‼'} 16 | let g:lsp_diagnostics_signs_info = {'text': 'ℹ'} 17 | let g:lsp_diagnostics_signs_hint = {'text': '?'} 18 | let g:lsp_diagnostics_signs_insert_mode_enabled=0 " Please don't bother me while I type 19 | 20 | " Folding 21 | set foldmethod=expr 22 | \ foldexpr=lsp#ui#vim#folding#foldexpr() 23 | \ foldtext=lsp#ui#vim#folding#foldtext() 24 | 25 | function! s:on_lsp_buffer_enabled() abort 26 | setlocal omnifunc=lsp#complete 27 | setlocal signcolumn=yes 28 | if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif 29 | nmap gA (lsp-code-action-float) 30 | nmap gd (lsp-definition) 31 | nmap gs (lsp-document-symbol-search) 32 | nmap gS (lsp-workspace-symbol-search) 33 | nmap gr (lsp-references) 34 | nmap gi (lsp-implementation) 35 | nmap gt (lsp-type-definition) 36 | nmap rn (lsp-rename) 37 | nmap [g (lsp-previous-diagnostic) 38 | nmap ]g (lsp-next-diagnostic) 39 | nmap K (lsp-hover) 40 | endfunction 41 | 42 | augroup lsp_install 43 | au! 44 | " call s:on_lsp_buffer_enabled only for languages that has the server registered. 45 | autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() 46 | augroup END 47 | -------------------------------------------------------------------------------- /plugin/shell/fzf.vim: -------------------------------------------------------------------------------- 1 | nmap , :Files 2 | nmap ; :Buffers 3 | 4 | " Enable search capabilities if possible 5 | if executable('rg') 6 | nnoremap :Rg 7 | elseif executable('ag') 8 | nnoremap :Ag 9 | end 10 | 11 | " Settings 12 | let g:fzf_buffers_jump = 1 13 | let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"' 14 | 15 | " It doesn't read the env vars? 16 | " let $BAT_THEME="ansi" 17 | 18 | if empty($TMUX) 19 | " We are not inside tmux 20 | let g:fzf_layout = {'window': { 'width': 0.7, 'height': 0.6, 'yoffset': 0.2 } } 21 | let g:fzf_preview_window = 'right:40%' 22 | else 23 | "We are inside tmux, let's leverage it! 24 | let g:fzf_layout = {'tmux': '-p70%,60%'} 25 | end 26 | -------------------------------------------------------------------------------- /plugin/shell/nerdtree.vim: -------------------------------------------------------------------------------- 1 | " NERDtree 2 | map nt :NERDTreeToggle 3 | map nf :NERDTreeFind 4 | let NERDTreeQuitOnOpen=1 5 | let NERDTreeWinSize=35 6 | let NERDTreeCaseSensitiveSort=1 7 | let NERDTreeWinPos = "right" 8 | 9 | let NERDTreeIgnore=['\~$', '\.pyc$', '^\.DS_Store$', '^node_modules$', '.git$', '.ropeproject', '__pycache__'] 10 | 11 | " autocmd VimEnter * NERDTree | wincmd p 12 | 13 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif 14 | -------------------------------------------------------------------------------- /undodir/.gitignore: -------------------------------------------------------------------------------- 1 | # This file serves two purposes 2 | # 1. Create an undodir when the vimrc is cloned (vim won't create it for you). 3 | # 2. Prevent accidentally commit my entire computer history 4 | * 5 | !.gitignore 6 | 7 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | " danirod's public vimrc settings 2 | " Author and maintainer: Dani Rodríguez 3 | " Public backup at https://github.com/danirod/vimrc 4 | 5 | " Stop acting like classic vi 6 | set history=1000 7 | set nocompatible 8 | 9 | " Settings about files 10 | set encoding=utf-8 11 | scriptencoding utf-8 12 | filetype indent plugin on 13 | set autoindent 14 | set backspace=indent,eol,start 15 | set hidden 16 | 17 | " Settings for undofiles, swapfiles, other files 18 | set undodir=~/.vim/undodir 19 | set undofile 20 | set noswapfile 21 | set nobackup 22 | set viminfofile=~/.vim/info 23 | 24 | " Colorscheme configuration 25 | if &t_Co > 2 26 | syntax on 27 | set background=dark 28 | 29 | highlight Pmenu ctermbg=black ctermfg=white 30 | highlight PmenuSel ctermbg=black ctermfg=white cterm=reverse 31 | highlight VertSplit cterm=NONE ctermbg=NONE ctermfg=white gui=NONE guibg=NONE guifg=white 32 | highlight StatusLine cterm=underline ctermfg=yellow ctermbg=darkblue gui=underline guifg=yellow guibg=darkblue 33 | highlight StatusLineNC cterm=NONE ctermfg=gray ctermbg=darkblue gui=NONE guifg=gray guibg=darkblue 34 | 35 | " Syntax often gets messed up on files with multiple languages 36 | noremap :syntax sync fromstart 37 | inoremap :syntax sync fromstart 38 | endif 39 | 40 | if &t_Co > 16 41 | highlight Pmenu ctermbg=233 ctermfg=white 42 | highlight PmenuSel ctermbg=19 ctermfg=white cterm=NONE 43 | highlight PmenuSbar ctermbg=239 44 | highlight PmenuThumb ctermbg=245 45 | highlight Signcolumn ctermbg=234 46 | endif 47 | 48 | highlight ExtraWhitespace ctermbg=1 49 | match ExtraWhitespace /\s\+$/ 50 | 51 | set fillchars+=vert:\│ 52 | set ruler 53 | set laststatus=1 54 | set wildmenu 55 | set wildoptions=pum 56 | 57 | set foldlevelstart=999 58 | nnoremap za 59 | 60 | set nowrap 61 | set showmatch 62 | 63 | nmap :bnext 64 | nmap :bprev 65 | 66 | let mapleader=',' 67 | 68 | tnoremap 69 | --------------------------------------------------------------------------------