SkillAgentSearch skills...

Dotvim

Personal vim configuration: vimrc file and friends

Install / Use

/learn @samoshkin/Dotvim
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

dotvim

Personal Vim configuration designed in a modular way.

A warn note. I tested it on my local machine only so far. Most likely it depends on my own environment (terminal, OS, installed apps) in some unforeseen ways. With that said, I cannot guarantee the smooth experience on your machine. Be prepared to fix issues on your own.

Tested under:

  • vim @8.2 (Included patches: 1-2100)
  • iTerm2 @3.3.7
  • tmux @3.1c
  • MacOS Catalina @10.15.7
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

Table of Contents

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Features

  • Wide languages support via vim-polyglot
  • Motion. Respect display lines when text is soft wrapped. Smooth scroll for <C-u>, <C-d>,<C-f>, <C-b> page movements. Recenter screen after most motions. Includes a bunch of useful text objects: line, url, entire buffer, matchit % region, lines with same indentation, current fold, function/class, etc. Improved f and t movements via clever-f plugin.
  • Text manipulation commands and mappings. Insert new line above or below the cursor. Move lines around. Duplicate line. Delete/change/yank to start/end of the line. Split and join lines. Switch between a single-line statement and a multi-line one (if, for, function calls). Move function arguments around.
  • IDE-like features powered by coc.nvim and language servers. Go to definfion, peek into defintion in a preview window, find symbol references, search through document or workspace symbols, rename and refactor, highlight symbol under the cursor. Open a drawer with a tree-view outline of document symbols powered by vista.vim.
  • Insert mode completion (a.k.a IntelliSense) provided by coc.nvim and language servers.
  • Lint your files with a linter program of your choice and show diagnostic icons in the Vim's sign column on the left. Populate location list with a linter errors and navigate through them. Apply quick fix action to resolve the issue if provided by the language server.
  • Expad snippets for various languages as provided by honza/vim-snippets
  • Instant project-wide text search as you type using ripgrep and fzf. Live preview of a file and a line with match with syntax highlight enabled.
  • Fuzzy find for project or MRU files in an integrated fzf popup. Use fuzzy finder to look up for other things: Vim commands, help tags, opened buffers, tags, lines in the buffer. Enjoy live file previews as you search with syntax highlighting enabled.
  • Formatting. Format as-you-type when supported by a language server. Format whole buffer by Neoformat and CLI tools like Prettier, stylefmt, js-beautify and others. Formatting can be automatically triggerred on save, on leaving the insert mode, or manually on demand. If there's neither language server no dedicated format programs installed, it's still capable of removing trailing whitespaces at EOL and trailing new lines at EOF, changing indentation between tabs and spaces. Editorconfig support.
  • Buffer and window management. Working with split and tabs with ease. Copy file name or path. Maximize current split. Cycle between main and alternate buffer and tab. Smart quit window function.
  • Pick and open files using either nnn or NERDTree. Locate current file or explore project structure in a NERDTree drawer on the left side.
  • File type icons in a NERDTree and status line. Icons support requires using one of the NerdFont as your terminal's font.
  • Use Vim as a Git difftool or mergetool. Disabled syntax highlighting in a diff mode.
  • Git integration powered by fzf, vim-fugitive and vim-gitgutter. Browse git log, review commits and file diffs, browser Git object database (commits, trees, block), review git status files and make a commit. Undo, stage or preview diff hunks while working with a buffer.
  • Status line powered by lightline that includes only essential pieces of data. No bloated UI with heavy computations.
  • vim + tmux play nice together. <C-arrow> and <S-arrow> keys work smoothly. FocusGained and FocusLost events are properly captured by Vim (via tmux-plugins/vim-tmux-focus-events). <S-CR> and <C-CR> keys are added by configuring iTerm to send custom escape sequence. Different cursor shape is applied depending on the current mode.
  • Better quickfix and location lists with romainl/qf-vim
  • Opt-in auto-save behavior.
  • Save and restore Vim session. Session is associated with a particular directory. Thus, you can have an unique session for every project.
  • Better yank and paste behavior. Improved by vim-cutlass, vim-yoink and vim-subversive plugins.
  • Use universal-ctags to generate tags file when there's no language server support for the given file type.
  • Markdown support with live preview, syntax highlighting, fenced code block languages, TOC generation.
  • gruvbox color scheme

Screenshots

  • Screen #1. Multiple split windows with different file types. Two versions of status line - for active and inactive windows. Sign column with a diff hunk "added/changed/removed" indicators. Insert mode completion. Inline colors for "#hex" colors in CSS. gruvbox colorscheme.
  • Screen #2. Pick files or explore project structure using NERDTree or an integrated nnn file manager.
  • Screen #3. Peek into symbol definition in a preview window at the bottom. Tree-view drawer with a document symbols outline on the right side.
  • Screen #4. View linter and syntax errors for the current line in a popup. Sign column with a bug icons of different color depending on an issue level. List of all diagnostic issues within a file at the bottom.
  • Screen #5. Explore Git internal object database. Review commit, file tree or a file snapshot at that specific commit.
  • Screen #6. Use Vim as a git difftool.
  • Screen #7. Text-based project search showing results in a quickfix window.
  • Screen #8. Fuzzy find and open files in a popup with a live file preview on the right side.
  • Screen #9. Another use case for fuzzy finder. Search available Vim commands and execute them on selection.
  • Screen #10. Text-based project search showing results in a fuzzy finder popup with a live preview of the particular match on the right side.
  • Screen #11. Writing markdown file with a side-by-side live preview in a browser.

Installation

git clone https://github.com/samoshkin/dotvim ~/.vim
cd ~/.vim
./install.sh

Required external dependencies. Make sure they are installed and are available on PATH:

  • fzf, A command-line fuzzy finder.
  • nnn, n³ The unorthodox terminal file manager.
  • delta, A viewer for git and diff output.
  • rg, modern and fast grep replacement.
  • bat, cat(1) clone with syntax highlighting.
  • Change your terminal's font to one of the NerdFont family (e.g. DroidSansMono NerdFont). This is needed to render file type icons.
  • universal ctags. exuberant-ctags do not fit.
  • git

Mappings

Most native Vim mappings work as you expect. This config follows and builds upon the ideology and spirit of the Vim, rather than fighting against it.

leader and localleader are mapped as:

nnoremap <Space> <Nop>
let mapleader=" " "<Space>
let maplocalleader=","

Toggle various settings/feature ON and OFF with a uniform mapping that starts with <leader>t, for example:

nmap <leader>ts     :ToggleSyntax<CR>
nmap <leader>th     :set hlsearch!<CR>
nmap <leader>tl     <Plug>(qf_loc_toggle_stay)
nmap <leader>tq     <Plug>(qf_qf_toggle_stay)
nmap <leader>tt     :GutentagsToggle<CR>
nmap <leader>t{}    :DelimitMateSwitch<CR>
nmap <leader>tp     :set paste!<CR>
nmap <leader>td   

Related Skills

View on GitHub
GitHub Stars58
CategoryDevelopment
Updated7mo ago
Forks3

Languages

Vim script

Security Score

72/100

Audited on Aug 5, 2025

No findings