Skip to content

Instantly share code, notes, and snippets.

@ageyev
Last active August 22, 2023 10:58
Show Gist options
  • Save ageyev/3ac5b2935b0329540ecc1b95924686dc to your computer and use it in GitHub Desktop.
Save ageyev/3ac5b2935b0329540ecc1b95924686dc to your computer and use it in GitHub Desktop.
minimal .vimrc
set nocompatible
"to get the File, Open dialog box to default to the current file's directory
set browsedir=buffer
" Change Working Directory to that of the current file
cmap cwd lcd %:p:h
cmap cd. lcd %:p:h
cmap w!! w !sudo tee % >/dev/null
"show linenumbers
set number
" Enable syntax highlighting // < the command is not available in this version: syntax on
" syntax on
" Automatically indent when adding a curly bracket, etc.
set smartindent
" Tabs should be converted to a group of 4 spaces.
" This is the official Python convention
" (http://www.python.org/dev/peps/pep-0008/)
" I didn't find a good reason to not use it everywhere.
set shiftwidth=4
set tabstop=4
set expandtab
set smarttab
" Use UTF-8.
set encoding=utf-8
" colorsheme:
" desert
" molokai
" etc.
" if has("gui_running")
" colorscheme desert
"else
" colorscheme darkblue
"endif
" Status line
" Always display the status line, even if only one window is displayed
set laststatus=2
set statusline=
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " filename
set statusline+=%h%m%r%w " status flags
set statusline+=\[%{strlen(&ft)?&ft:'none'}] " file type
set statusline+=%= " right align remainder
set statusline+=0x%-8B " character value
set statusline+=%-14(%l,%c%V%) " line, character
set statusline+=%<%P " file position
" Show line number, cursor position.
set ruler
" Enable mouse use in all modes
set mouse=a
" Display incomplete commands.
set showcmd
" Search as you type.
set incsearch
" Ignore case when searching.
set ignorecase
" Show autocomplete menus.
set wildmenu
" Show editing mode
set showmode
"""" Key Bindings
" move vertically by visual line (don't skip wrapped lines)
nmap j gj
nmap k gk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment