Skip to content

Instantly share code, notes, and snippets.

@meyt
Created September 4, 2018 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meyt/c3507d976adcf1a88369371ef548091a to your computer and use it in GitHub Desktop.
Save meyt/c3507d976adcf1a88369371ef548091a to your computer and use it in GitHub Desktop.
" Plugins
call plug#begin()
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'python-mode/python-mode'
Plug 'posva/vim-vue'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-syntastic/syntastic'
Plug 'nvie/vim-flake8'
Plug 'vim-scripts/indentpython.vim'
" End of plug
call plug#end() " required
filetype plugin indent on " required
""""""""""""""""""""""""""""""
" Color Scheme
syntax enable
colorscheme palenight
set background=dark
set tabstop=8
set expandtab shiftwidth=4 softtabstop=4
set number
set showmatch
set t_Co=256 " Force use 256 color to terminal
set hlsearch
set colorcolumn=81
let g:python_highlight_all = 1
let python_highlight_all = 1
" au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
autocmd FileType vue syntax sync fromstart
autocmd BufRead,BufNewFile *.vue setlocal filetype=vue.html.javascript.css
" For vim > 7.4.1
if (has("termguicolors"))
set termguicolors
endif
" General VIM
"
"" Setup folder structure
"
if !isdirectory(expand('~/.vim/undo/', 1))
silent call mkdir(expand('~/.vim/undo', 1), 'p')
endif
if !isdirectory(expand('~/.vim/backup/', 1))
silent call mkdir(expand('~/.vim/backup', 1), 'p')
endif
if !isdirectory(expand('~/.vim/swap/', 1))
silent call mkdir(expand('~/.vim/swap', 1), 'p')
endif
" Linelength
"highlight OverLength ctermbg=red ctermfg=white guibg=#592929
"match OverLength /\%81v.\+/
"set clipboard=unnamed " System clipboard
set encoding=utf-8
set nofoldenable " disable folding
set clipboard=unnamedplus " System clipboard on VIM 7.3.74+
" Show the matching when doing a search
set showmatch
" Ignore case when doing a search as well as highlight it as it is typed
set ignorecase smartcase
set hlsearch
set incsearch
" Don't show the startup message
set shortmess=I
" Better completion
set completeopt+=longest,menuone,preview
" Use backups " " Source:
" " http://stackoverflow.com/a/15317146
set backup
set writebackup
set backupdir=~/.vim/backup//
" Use a specified swap folder
" " Source:
" " http://stackoverflow.com/a/15317146
set directory=~/.vim/swap//
" The comma makes a great leader of men, heh heh
let mapleader = ','
let maplocalleader = '\'
" Always show the last line
set display+=lastline
" UTF-8 THIS SHITTTTTT
set encoding=utf-8
" Spell checking
set spelllang=en
set spell
hi clear SpellBad
hi SpellBad cterm=undercurl ctermfg=red
" Its suggested by gitgutter to show diffs
" in short period instead of VIM's default
set updatetime=100
" Ctrl+p plugin
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra' " set its local working directory
""""""""""""""""""""""""""""""
" File Browser / nerdtree
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
map <F9> :NERDTreeToggle<CR>
" Open NERDTree automatically
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
" Close VIM if the only window left open is a NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
""""""""""""""""""""""""""""""
" Syntax Checker
set autoindent
filetype indent plugin on
""""""""""""""""""""""""""""""
" Syntax highlighting
"Plug 'vim-python/python-syntax'
"let g:ycm_autoclose_preview_window_after_completion=1
"map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"let g:ycm_python_binary_path = 'python3.6'
""""""""""""""""""""""""""""""
" Statusbar
""""""""""""""""""""""""""""""
" Python virtualenv support
py3 << EOF
import os
import sys
project_base_dir = './venv'
activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
#print(activate_this)
if os.path.exists(activate_this):
with open(activate_this) as f:
exec(f.read(), dict(__file__=activate_this))
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment