Skip to content

tonybanters/vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vim Configuration

Keybindings

General

ModeKeyAction
-<Space>Leader key
Normal<leader>cdOpen netrw file explorer
Normal<leader>rlReload vimrc
Normal<leader><leader>Source current file
Insert<C-c>Behave like <Esc>
NormalQDisabled (no Ex mode)

Editing

ModeKeyAction
VisualJMove selected lines down
VisualKMove selected lines up
NormalJJoin lines with cursor preserved
Visual<leader>pPaste without overwriting clipboard
Normal/Visual<leader>dDelete without overwriting clipboard
Normal<leader>sSubstitute word under cursor on line
Normal<leader>xMake current file executable
Normal<leader>dgGenerate documentation (Doge)

Navigation

ModeKeyAction
Normal<C-d>Scroll half-page down and center
Normal<C-u>Scroll half-page up and center
NormalnNext search result (centered)
NormalNPrevious search result (centered)
Normal<C-j>Next location list item
Normal<C-k>Previous location list item
Normal<leader>kNext location list (centered)
Normal<leader>jPrevious location list (centered)
Normal<leader>clClose location list

FZF

ModeKeyAction
Normal<leader>ffFind files
Normal<leader>foFile history
Normal<leader>fbOpen buffers
Normal<leader>fqQuickfix list
Normal<leader>fhHelp tags
Normal<leader>fsGrep current word under cursor
Normal<leader>fgGrep (prompt for input)
Normal<leader>fcGrep for current filename
Normal<leader>fiFind files in ~/.vim config

Clipboard (OSCYank)

ModeKeyAction
Normal/Visual<leader>yYank via OSCYank

Dependencies

Required

  • git - For plugin management
  • vim - 8.0+ recommended
  • ripgrep (rg) - Fast grep alternative for FZF
  • fd - Fast find alternative for FZF
  • fzf - Fuzzy finder

Optional

  • rust-analyzer - Rust LSP server
  • typescript-language-server - TypeScript/JavaScript LSP
  • intelephense - PHP LSP

Installation

Arch Linux

sudo pacman -S git vim ripgrep fd fzf
sudo pacman -S rust-analyzer  # optional
npm install -g typescript-language-server  # optional

NixOS

nix-env -iA nixpkgs.git nixpkgs.vim nixpkgs.ripgrep nixpkgs.fd nixpkgs.fzf
nix-env -iA nixpkgs.rust-analyzer  # optional
npm install -g typescript-language-server  # optional

Gentoo

sudo emerge --ask dev-vcs/git app-editors/vim sys-apps/ripgrep sys-apps/fd app-shells/fzf
sudo emerge --ask dev-lang/rust-bin  # for rust-analyzer
npm install -g typescript-language-server  # optional

Linux (Debian/Ubuntu)

sudo apt install git vim ripgrep fd-find fzf
# Note: fd is called fd-find on Debian/Ubuntu

macOS

brew install git vim ripgrep fd fzf
brew install rust-analyzer  # optional
npm install -g typescript-language-server  # optional

Rust Analyzer

rustup component add rust-analyzer

Setup

1. Clone or copy your Vim configuration

git clone <your-repo> ~/.vim

2. Configure Bash/Zsh

Add to ~/.bashrc or ~/.zshrc:

export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow'

Then source your shell config:

source ~/.bashrc  # or ~/.zshrc

3. Configure fd ignore file

Create ~/.fdignore:

vim ~/.fdignore

Add these lines:

undodir/
plugged/
.git

4. Configure ripgrep ignore file

Create ~/.rgignore:

vim ~/.rgignore

Add the same patterns:

undodir/
plugged/
.git

5. Install plugins

Open Vim and the plugins will auto-install on first run.

Plugin List

PluginPurpose
junegunn/fzfFuzzy finder
junegunn/fzf.vimFZF Vim integration
tomasiser/vim-code-darkCode Dark color scheme
ghifarit53/tokyonight-vimTokyo Night color scheme
yegappan/lspLSP client
ojroques/vim-oscyankCopy to system clipboard via OSC52
tpope/vim-commentaryComment/uncomment code
itchyny/lightline.vimStatusline

File Structure

~/.vim/
├── vimrc           # Main config (sources all below)
├── options.vim     # Vim options and settings
├── keybinds.vim    # Keybindings
├── plugins.vim     # Plugin manager and plugin list
├── colors.vim      # Color scheme configuration
├── fzf.vim         # FZF configuration
├── lightline.vim   # Lightline configuration
└── plugged/        # Plugin installation directory

Usage

Installing Plugins

Plugins auto-install when you first start Vim. To manually reinstall, delete ~/.vim/plugged and restart Vim.

Updating Plugins

cd ~/.vim/plugged/<plugin-name>
git pull

FZF File Search

The FZF configuration respects .gitignore, .fdignore, and .rgignore files automatically.

Use <leader>ff to search files, <leader>fg to grep content.

LSP Servers

Configure LSP servers in your config. Currently configured:

  • Rust: rust-analyzer
  • TypeScript/JavaScript: typescript-language-server
  • PHP: intelephense

Notes

  • The plugin manager is custom and minimal - it auto-installs plugins on Vim startup
  • .fdignore and .rgignore prevent searching through plugin directories and undo files
  • FZF uses fd for file listing (faster than find) and rg for content search
  • OSCYank allows copying to system clipboard even over SSH

About

vanilla vim config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published