Skip to content

ikelaiah/vimrc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Corporate-Safe Vim Configuration

Corporate Safe Vim

Vim 8+ Made with Vim Plugins Dependencies License

A pure Vim configuration designed for restricted corporate environments.

No plugins. No external tools. No Python / Node / ripgrep / ctags calls.

Just stock Vim features used effectively.


Features

  • Plugin-free
  • Self-contained .vimrc
  • Works on stock Vim (Linux, macOS, Windows)
  • Truecolor support
  • Gruvbox fallback to Desert
  • Sidebar file explorer
  • Project search using vimgrep
  • Whitespace visibility (tabs, trailing spaces, nbsp)
  • Language-aware indentation (consistent tabstop/shiftwidth/softtabstop per filetype)
  • Count-aware j/k motion (works with 5j, 10k, etc.)
  • Hidden buffers for easier switching between unsaved files
  • Smarter built-in completion and command-line matching
  • No swap files
  • Auto-reload files changed outside Vim
  • Auto-save and restore sessions (terminal buffers excluded)

Supported languages:

  • SQL
  • CSS
  • JavaScript
  • Python
  • JSON
  • Markdown
  • PHP
  • YAML
  • TOML
  • INI
  • Lua
  • C / C++
  • Java
  • Object Pascal

Screenshot

Example editing experience using this configuration.

Screenshot of Vim with this configuration

Editing Python with:

  • relative line numbers
  • cursor line highlight
  • whitespace markers
  • color column at 100
  • Gruvbox theme

Installation

Linux / macOS

~/.vimrc

Windows

%USERPROFILE%\_vimrc

On Windows, Vim also creates its runtime directories under ~/vimfiles/ (backup, undo, sessions) automatically.

Restart Vim after installing.


Quick Install

Linux / macOS (curl)

curl -fsSL https://raw.githubusercontent.com/ikelaiah/vimrc/main/.vimrc -o ~/.vimrc

Windows (PowerShell)

Invoke-WebRequest https://raw.githubusercontent.com/ikelaiah/vimrc/main/.vimrc -OutFile $HOME\_vimrc

Theme Behavior

The configuration prefers Gruvbox if available.

colorscheme gruvbox

If Gruvbox is unavailable, Vim falls back to:

colorscheme desert

Sidebar File Explorer

Open the sidebar file explorer:

Space e

This uses Vim's built-in netrw in sidebar mode (Lexplore).

Features:

  • left sidebar
  • tree view
  • quick file navigation
  • no plugins required

Navigation

Leader key: Space


Files

Action Shortcut
Open file Space f
Sidebar explorer Space e
Switch last file Space Space

Project Search

Action Shortcut
Search project Space g
Next result ]q
Previous result [q

Example:

:vimgrep /TODO/ **/*.py

Buffers

Action Shortcut
Next buffer Space bn
Previous buffer Space bp
Close buffer Space bd

Windows

Action Shortcut
Move left Ctrl h
Move down Ctrl j
Move up Ctrl k
Move right Ctrl l
Cycle to next window Ctrl w w
Split horizontally Space -
Split vertically Space \
Equalise all windows Space =
Close current split Space c
Keep only current split Space o

Resize windows:

Space ← → ↑ ↓

Save / Quit

Action Shortcut
Save Space w
Quit (prompts if unsaved) Space q
Save & quit Space x
Force quit (discard changes) Space Q

Sessions

Sessions save and restore your window layout, open files, and folds. Terminal buffers and missing files are automatically excluded on restore.

Action Shortcut
Save session Space ss
Restore session Space sr
Delete session Space sd

Auto-save / auto-restore: When Vim is opened with no file arguments, the last session is automatically restored on startup and saved on exit.

Safe restore: The following buffer types are automatically discarded on restore:

  • Terminal buffers (term://) — stuck terminals can never block startup
  • netrw explorer buffers — avoids broken internal tree state errors
  • Quickfix / location list windows
  • Scratch buffers (help, man pages, previews)
  • Files that no longer exist on disk

Exiting Vim

The recommended ways to exit, from most to least cautious:

Situation Command What it does
Save and quit current window Space x Writes only if changed, then quits
Save and quit current window :x Same as above (built-in command)
Save and quit :wq Always writes, then quits
Quit with prompt if unsaved Space q Prompts Save/Discard/Cancel
Quit (no unsaved changes) :q Quits if buffer is clean
Force quit, discard changes Space Q Discards all changes, no prompt
Force quit :q! Discards unsaved changes, then quits
Quit all windows :qa Quits all windows (fails if unsaved)
Quit all, discard all changes :qa! Force-quits everything
Save all and quit all :wqa Saves all buffers, quits all windows

Tip: If you are stuck in insert mode, press Esc first, then use any of the above.

Tip: If you opened a terminal inside Vim (:terminal) and it is unresponsive, close it with :bwipeout! or quit all with :qa!.


Editing Quality of Life

Clear search highlight:

Space /

Toggle paste mode:

F2

Toggle wrap:

Space z

Toggle whitespace markers:

Space l

Trailing whitespace is visually highlighted but not automatically removed on save.


Philosophy

This configuration focuses on three principles:

Reliability

Works everywhere Vim runs.

Compliance

Safe for environments that forbid plugins or external tools.

Speed

Navigation should be faster than thinking.


Why This Exists

Many corporate environments restrict developers from installing:

  • Vim plugins
  • external binaries
  • scripting runtimes

This repository demonstrates that Vim can still provide a productive editing experience using only built-in functionality.


License

MIT License

About

A pure Vim configuration designed for restricted corporate environments.

Topics

Resources

License

Stars

Watchers

Forks

Contributors