From 8f8f87ea93f870885331fa1c06d3bddfe4352014 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Wed, 8 Apr 2026 16:09:38 -0400 Subject: [PATCH] removed IDE-like features --- README.md | 25 +++++++--------------- vimrc | 62 +++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 11bae6c..4d23289 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Vim Config -Lightweight vim config. +Lightweight Vim config that mirrors the core editing feel of the Neovim setup without the IDE stack. ## Install @@ -30,8 +30,6 @@ Requires `curl` and `git` for vim-plug bootstrap. On NixOS this is managed via h | vim-log-highlighting | Syntax highlighting for log files | | vim-highlightedyank | Flash feedback on yank | | lightline.vim | Statusline | -| vim-fugitive | Git commands (`:Git status`, `:Git blame`, etc.) | -| vim-signify | Git diff signs in the gutter | | vim-anzu | Search match count in statusline | ## Keybinds @@ -42,8 +40,8 @@ Leader is `Space`. | Key | Action | |-----|--------| | `e` | Toggle netrw sidebar | -| `/` | Ripgrep search | -| `ff` | Find files (fzf) | +| `/` | Ripgrep search from git root | +| `ff` | Find files from git root (fzf) | | `fp` | Recent files (fzf) | | `fb` | Open buffers (fzf) | | `?` | Command history (fzf) | @@ -52,26 +50,17 @@ Leader is `Space`. | Key | Action | |-----|--------| | `H` / `L` | Previous / next buffer | -| `bd` | Force close buffer | +| `bd` | Delete buffer safely | ### Windows | Key | Action | |-----|--------| | `` | Navigate windows (skips netrw) | | `` | Resize windows | -| `wh` | Horizontal split | +| `wc` | Close window | +| `ws` | Horizontal split | | `wv` | Vertical split | -| `wd` | Close window | - -### Git -| Key | Action | -|-----|--------| -| `gs` | Git status | -| `gl` | Git log | -| `gd` | Git diff | -| `gb` | Git blame | -| `ga` | Git add | -| `gc` | Git commit | +| `wm` | Maximize window | ### Other | Key | Action | diff --git a/vimrc b/vimrc index 5338aa3..7a526d5 100644 --- a/vimrc +++ b/vimrc @@ -16,24 +16,25 @@ call plug#begin('~/.vim/plugged') Plug 'mtdl9/vim-log-highlighting' Plug 'machakann/vim-highlightedyank' Plug 'itchyny/lightline.vim' - Plug 'tpope/vim-fugitive' - Plug 'mhinz/vim-signify' Plug 'osyo-manga/vim-anzu' call plug#end() let mapleader = "\" set background=dark +if has('termguicolors') + set termguicolors +endif silent! colorscheme base16-onedark -highlight Normal ctermbg=NONE guibg=NONE +highlight Normal ctermbg=NONE guibg=NONE ctermfg=White guifg=#FFFFFF highlight NonText ctermbg=NONE guibg=NONE highlight CursorLine ctermbg=NONE guibg=NONE -highlight CursorLineNr ctermfg=Yellow guifg=#FFCC66 ctermbg=NONE guibg=NONE cterm=bold -highlight HighlightedyankRegion ctermfg=Black guifg=#FFFFFF ctermbg=Yellow guibg=#FFA500 +highlight CursorLineNr ctermfg=Yellow guifg=#E5C07B ctermbg=NONE guibg=NONE cterm=bold gui=bold +highlight HighlightedyankRegion ctermfg=Black guifg=#000000 ctermbg=Yellow guibg=yellow highlight NormalNC ctermbg=NONE guibg=NONE highlight Search ctermfg=Black guifg=#000000 ctermbg=Yellow guibg=#FFCC66 highlight LineNr ctermbg=NONE guibg=NONE -highlight Visual ctermbg=LightGray guibg=#E8E8E8 ctermfg=Black guifg=#000000 +highlight Visual ctermbg=Gray guibg=Gray ctermfg=Black guifg=Black let g:highlightedyank_highlight_duration = 140 let g:lightline = { 'colorscheme': 'deus', } @@ -74,7 +75,10 @@ set hidden set tabstop=2 set shiftwidth=2 +set softtabstop=2 set expandtab +set smartindent +set fillchars=eob:\ set statusline=%{exists('*anzu#search_status')?anzu#search_status():''} @@ -102,6 +106,31 @@ function! SafeWincmd(dir) execute 'wincmd ' . a:dir endfunction +function! GitRoot() + let l:root = systemlist('git rev-parse --show-toplevel') + if v:shell_error == 0 && !empty(l:root) && !empty(l:root[0]) + return l:root[0] + endif + return getcwd() +endfunction + +function! SafeBdelete() + if &filetype ==# 'netrw' + echohl WarningMsg | echom 'Cannot delete buffer from netrw' | echohl None + return + endif + + let l:buflisted = getbufinfo({'buflisted': 1}) + if len(l:buflisted) <= 1 + echohl WarningMsg | echom 'Cannot delete last buffer' | echohl None + return + endif + + let l:buf = bufnr('%') + bprevious + execute 'bdelete ' . l:buf +endfunction + " --- Plugin management --- nnoremap pu :PlugUpdate nnoremap pd :PlugUpgrade @@ -114,7 +143,7 @@ nmap N (anzu-N-with-echo) nmap * (anzu-star-with-echo) nmap # (anzu-sharp-with-echo) nmap (anzu-clear-search-status) -nnoremap :noh +nnoremap :nohlet @/="" " --- Visual indentation --- vnoremap < :resize +10 nnoremap :resize -10 " --- Window management --- -nnoremap wh :split +nnoremap wc :close +nnoremap ws :split nnoremap wv :vsplit -nnoremap wd :q +nnoremap wm _ nnoremap ww :wincmd w nnoremap wW :wincmd W -" --- Git (fugitive) --- -nnoremap gs :Git status -nnoremap gl :Git log -nnoremap ga :Git add -nnoremap gc :Git commit -nnoremap gd :Git diff -nnoremap gb :Git blame - " --- File explorer & search --- nnoremap e :call NetrwToggle() -nnoremap / :Rg -nnoremap ff :Files +nnoremap / :execute 'lcd ' . fnameescape(GitRoot()) Rg +nnoremap ff :execute 'lcd ' . fnameescape(GitRoot()) Files nnoremap fp :History nnoremap fb :Buffers nnoremap ? :History: " --- Buffers --- -nnoremap bd :bd! +nnoremap bd :call SafeBdelete() nnoremap H :bprevious nnoremap L :bnext