Skip to content

Instantly share code, notes, and snippets.

@pxy0592
Created August 30, 2023 16:08
Show Gist options
  • Select an option

  • Save pxy0592/09501efe13cc5abfca5d96797df68f04 to your computer and use it in GitHub Desktop.

Select an option

Save pxy0592/09501efe13cc5abfca5d96797df68f04 to your computer and use it in GitHub Desktop.
Personal .vimrc
"""" Enable Vundle: vim plugin manager
" Description: refer to https://chrisyeh96.github.io/2017/12/18/vimrc.html
" required before Vundle initialization
" set nocompatible " disable compatibility mode with vi
" filetype off " disable filetype detection (but re-enable later, see below)
" set the runtime path to include Vundle, and initialize
" set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin()
" Plugin 'VundleVim/Vundle.vim'
" Plugin 'wting/rust.vim' " enable syntax highlighting for rust
" call vundle#end()
"""" Basic Behavior
set number " show line numbers
set wrap " wrap lines
set encoding=utf-8 " set encoding to UTF-8 (default was "latin1")
set mouse=a " enable mouse support (might not work well on Mac OS X)
set wildmenu " visual autocomplete for command menu
set lazyredraw " redraw screen only when we need to
set showmatch " highlight matching parentheses / brackets [{()}]
set laststatus=2 " always show statusline (even with only single window)
set ruler " show line and column number of the cursor on right side of statusline
set visualbell " blink cursor on error, instead of beeping
"""" Tab settings
set tabstop=4 " width that a <TAB> character displays as
set expandtab " convert <TAB> key-presses to spaces
set shiftwidth=4 " number of spaces to use for each step of (auto)indent
set softtabstop=4 " backspace after pressing <TAB> will remove up to this many spaces
set autoindent " copy indent from current line when starting a new line
set smartindent " even better autoindent (e.g. add indent after '{')
""""" Vim Appearance
" put colorscheme files in ~/.vim/colors/
colorscheme seoul256 " good colorschemes: murphy, slate, molokai, badwolf, solarized
" use filetype-based syntax highlighting, ftplugins, and indentation
syntax enable
filetype plugin indent on " load filetype-specific indent files
" Jenkinsfile syntax highlighting
au BufNewFile,BufRead *[jJ]enkinsfile* setf groovy
""""" Searching settings
nnoremap / /\v
vnoremap / /\v
set hlsearch " search as characters are entered
set incsearch " highlight matches
set ignorecase
set smartcase
set showmatch
map <leader><space> :let @/=''<cr> " clear search
" turn off search highlighting with <CR> (carriage-return)
nnoremap <CR> :nohlsearch<CR><CR>
"""" Miscellaneous settings that might be worth enabling
set cursorline " highlight current line
"set background=dark " configure Vim to use brighter colors
"set autoread " autoreload the file in Vim if it has been changed outside of Vim
"""" 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