Skip to content

Instantly share code, notes, and snippets.

@muppetjones
Last active April 9, 2022 15:01

Revisions

  1. muppetjones revised this gist Apr 9, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .vimrc
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    syntax enable
    filetype plugin indent on
    colorscheme molokai "solarized
    colorscheme delek

    " Use Vim settings, rather then Vi settings (much better!).
    " This must be first, because it changes other options as a side effect.
  2. muppetjones created this gist Apr 9, 2022.
    77 changes: 77 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,77 @@
    syntax enable
    filetype plugin indent on
    colorscheme molokai "solarized

    " Use Vim settings, rather then Vi settings (much better!).
    " This must be first, because it changes other options as a side effect.
    set nocompatible

    " ================ General Config ====================

    set number "Line numbers are good.
    set ruler "Show row/column position.
    set backspace=indent,eol,start "Allow backspace in insert mode
    set history=1000 "Store lots of :cmdline history
    set showcmd "Show incomplete cmds down the bottom
    set showmode "Show current mode down the bottom
    set gcr=a:blinkon0 "Disable cursor blink
    set visualbell "No sounds
    set autoread "Reload files changed outside vim


    " JSON
    autocmd BufNewFile,BufRead *.json set ft=javascript
    " MD
    autocmd BufNewFile,BufReadPost *.md set filetype=markdown

    " ================ Turn Off Swap Files ==============

    set noswapfile
    set nobackup
    set nowb

    " ================ Peristent Position ===============
    " Return to last edit position when opening files (You want this!)
    autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \ exe "normal! g`\"" |
    \ endif
    " Remember info about open buffers on close
    set viminfo^=%

    " ================ Indentation ======================

    set autoindent
    set smartindent
    set smarttab
    set shiftwidth=4
    set softtabstop=4
    set tabstop=4
    set expandtab " Use spaces

    filetype plugin on
    filetype indent on

    " Display tabs and trailing spaces visually
    set list listchars=tab:\ \ ,trail:·

    set nowrap "Don't wrap lines
    set linebreak "Wrap lines at convenient points

    " ================ Folds ============================

    set foldmethod=indent "fold based on indent
    set foldnestmax=3 "deepest fold is 3 levels
    set nofoldenable "dont fold by default

    " ================ Scrolling ========================

    set scrolloff=8 "Start scrolling when we're 8 lines away from margins
    set sidescrolloff=15
    set sidescroll=1

    " ================ Powerline ========================

    set laststatus=2 " Always display the statusline in all windows
    set showtabline=2 " Always display the tabline, even if there is only one tab
    set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)