Skip to content

Instantly share code, notes, and snippets.

@taufik-nurrohman
Last active November 12, 2020 06:36
Show Gist options
  • Save taufik-nurrohman/4b80ea5bbbd25f5351e0c7b08972544c to your computer and use it in GitHub Desktop.
Save taufik-nurrohman/4b80ea5bbbd25f5351e0c7b08972544c to your computer and use it in GitHub Desktop.
Generic Vim Settings
" Set default encoding
set encoding=utf-8
" Show line number(s)
set number
set ruler
" Enable line wrap
set wrap
" Show command(s)
set showcmd
" Do not `hlsearch` until I press <ENTER>
set noincsearch
set hlsearch
set ignorecase
set smartcase
" Indent with 2 space(s)
set tabstop=2
set shiftwidth=2
" Automatic indentation
set smarttab
set expandtab
set wildmenu
set autoread
set history=1000
" Immediately scroll before reaching edge
set scrolloff=8
set sidescroll=1
set sidescrolloff=15
set mouse=a
set title
set nocompatible
set t_Co=256
set t_AB=^[[48;5;%dm
set t_AF=^[[38;5;%dm
set term=xterm-256color
" Set color scheme
"colorscheme sunburst
filetype plugin indent on
syntax on
" Clear search marker with <CTRL>+<L>
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
" If you are using pathogen
"execute pathogen#infect()
@taufik-nurrohman
Copy link
Author

taufik-nurrohman commented Oct 24, 2020

NERDTree specific settings:

let NERDTreeDirArrows=1

" Hide help text and up level description
" To up one level directory, press <U>
let NERDTreeMinimalUI=1

" Close `NERDTree` on file open
"let NERDTreeQuitOnOpen=1

" Show hidden files
let NERDTreeShowHidden=1

" Hide these files from the tree
set wildignore+=*.pyc,*.o,*.obj,*.svn,*.swp,*.class,*.hg,*.DS_Store
let NERDTreeRespectWildIgnore=1

" Dummy variable
autocmd StdInReadPre * let s:std_in=1
" Automatically open `NERDTree` when vim starts up with no file specified
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Automatically open `NERDTree` on file open, then focus to the file contents
autocmd VimEnter * if argc() != 0 && !exists("s:std_in") | NERDTree | wincmd p | endif

" Automatically close `NERDTree` on last file close
autocmd BufEnter * if winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree() | q | endif

" Press <CTRL>+<N> to toggle `NERDTree`
map <silent> <C-N> :NERDTreeToggle<CR>

@taufik-nurrohman
Copy link
Author

2020-11-04 01:02:55.825

@taufik-nurrohman
Copy link
Author

taufik-nurrohman commented Nov 11, 2020

⚠️ Update!

Moved to @taufik-nurrohman/vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment