Skip to content

Instantly share code, notes, and snippets.

@ibuys
Created April 30, 2020 18:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ibuys/12147c7652018c5a9b6977e26ebb072c to your computer and use it in GitHub Desktop.
" Specify a directory for plugins
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" You will load your plugin here
" Make sure you use single quotes
" Initialize plugin system
Plug 'tomtom/tcomment_vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'rakr/vim-one'
Plug 'ayu-theme/ayu-vim'
Plug 'sheerun/vim-polyglot'
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-syntastic/syntastic'
Plug 'godlygeek/tabular'
Plug 'elzr/vim-json'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'psf/black'
Plug 'davidhalter/jedi-vim'
Plug 'vimwiki/vimwiki'
Plug 'cweagans/vim-taskpaper'
call plug#end()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General Configuration
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader = ','
filetype on
syntax on
" make backspaces delete sensibly
set backspace=indent,eol,start
" Autosave buffer when switching
set autowrite
" Ignore cse when search pattern is all lowercase
set smartcase
set ignorecase
set hlsearch
nnoremap <silent> <Esc> :nohlsearch<Bar>:echo<CR>
" Cleanup backup and temp files
set backupdir=~/.vim/tmp/
set directory=~/.vim/tmp/
" Absolute width of netrw window
let g:netrw_winsize = -28
" tree-view
let g:netrw_liststyle = 3
" sort is affecting only driectories on the top, files below
let g:netrw_sort_sequence = '[\/]$,*'
" open file in a new tab
let g:netrw_browse_split = 3
set expandtab
set gcr=n:blinkon0
set shortmess=atI
set visualbell
set noerrorbells
set smartindent
set tabstop=4
set shiftwidth=4
set softtabstop=4
set guioptions-=T
set guioptions=Ace
set backupcopy=yes
set undofile
set undodir=~/.vim/undodir
set hlsearch
" I'm getting tired of accidentally holding down the shift key...
" Reissue `w` even if I capitalize it...
com W w
com Wq wq
com WQ wq
let python_highlight_all=1
runtime macros/matchit.vim
noremap <silent> <Leader>cc :TComment<CR>
" Leader F is for file related mappings (open, browse…)
nnoremap <silent> <Leader>f :CtrlP<CR>
nnoremap <silent> <Leader>fm :CtrlPMRU<CR>
nnoremap K :!open dict:///<cword><cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Ctrl B for buffer related mappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nnoremap <silent> <Leader>b :CtrlPBuffer<CR> " cycle between buffer
nnoremap <silent> <Leader>bb :bn<CR> " create (N)ew buffer
nnoremap <silent> <Leader>bd :bdelete<CR> " (D)elete current buffer
nnoremap <silent> <Leader>bu :bunload<CR> " (U)nload current buffer
nnoremap <silent> <Leader>bl :etnomodifiableCR> " (L)ock current buffer
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Appearance
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
set background=light
set termguicolors
" let ayucolor="light"
" colorscheme one
colorscheme solarized
set guifont=Menlo:h12
" set macligatures
" set guifont=Fira\ Code:h12
" Highlight the matching parenthesis
set showmatch
" reloads .vimrc -- making all the changes active
map <silent> <Leader>v :source ~/.vimrc<CR>:PlugInstall<CR>:bdelete<CR>:exe ":echo 'vimrc reloaded'"<CR>
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Syntastic
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_opoen = 1
let g:syntastic_check_on_wq = 0
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Tabular
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vnoremap <silent> <Leader>cee :Tabularize /=<CR>
vnoremap <silent> <Leader>cet :Tabularize /=<CR>
vnoremap <silent> <Leader>ce :Tabularize /
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Tabular
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
func! WordProcessorMode()
setlocal formatoptions=1
setlocal noexpandtab
map j gj
map k gk
setlocal spell spelllang=en_us
set thesaurus+=/Users/sbrown/.vim/thesaurus/mthesaur.txt
set complete+=s
set formatprg=par
setlocal wrap
setlocal linebreak
endfu
com! WP call WordProcessorMode()
func! NumberMode()
" Show relative && absolute line numbers
if version >=703
set relativenumber
set number
endif
endfu
com! NM call NumberMode()
function! Formd(option)
:let save_view = winsaveview()
:let flag = a:option
:if flag == "-r"
:%! ~/Unix/bin/formd/formd -r
:elseif flag == "-i"
:%! ~/Unix/bin/formd/formd -i
:else
:%! ~/Unix/bin/formd/formd -f
:endif
:call winrestview(save_view)
endfunction
function! s:goyo_enter()
set noshowmode
set noshowcmd
set scrolloff=999
Limelight
" ...
endfunction
let g:vimwiki_list = [{'path': '~/Documents/Technical/', 'syntax': 'markdown', 'ext': '.md'},
\ {'path': '~/Documents/TargetSmart/', 'syntax': 'markdown', 'ext': '.md'},
\ {'path': '~/Documents/Personal/', 'syntax': 'markdown', 'ext': '.md'}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment