Skip to content

Instantly share code, notes, and snippets.

@femmerling
Last active Aug 31, 2022
Embed
What would you like to do?
vim dotfile
set encoding=utf-8
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" plugin section
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'ervandew/supertab'
Plugin 'vim-scripts/darkspectrum'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-easytags'
Plugin 'Valloric/YouCompleteMe'
Plugin 'psf/black'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Enable clipboard
set clipboard=unnamed
set splitbelow
set splitright
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"" Themes and size
set guifont=Monaco:h12
set nu
set background=dark
colorscheme darkspectrum
"" Nerdtree settings
map <Leader>n :NERDTreeToggle<CR>
let NERDTreeIgnore=['\.pyc$', '\~$', '\.swp$'] "ignore files in NERDTree
let NERDTreeShowHidden=1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif"let python_highlight_all=1
"" Keybinding for openning terminal on a new split
map <Leader>t :term<CR>
"" Keybinding for black formatting
map <Leader>b :Black<CR>
let g:black_fast = 1
let g:black_linelength = 120
let g:black_skip_string_normalization = 1
let g:black_skip_magic_trailing_comma = 1
syntax on
"" Default tab settings
set tabstop=2
set shiftwidth=2
set expandtab
"" Set size
if has("gui_running")
set lines=999 columns=999
else
if exists("+lines")
set lines=50
endif
if exists("+columns")
set columns=100
endif
endif
"" Easytags
set tags=./tags;
let g:easytags_opts = ['--fields=+l']
let g:easytags_python_enabled = 1
let g:easytags_async=1
let g:easytags_auto_highlight=0
" Enable folding
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
" NERDCommenter Settings
filetype plugin on
let g:NERDSpaceDelims = 1
let g:NERDCompactSexyComs = 1
let g:NERDDefaultAlign = 'left'
let g:NERDTrimTrailingWhitespace = 1
" PEP8 stuffs
au BufNewFile,BufRead *.py
\ setf tabstop=4
\ setf softtabstop=4
\ setf shiftwidth=4
\ setf textwidth=79
\ setf expandtab
\ setf autoindent
\ setf fileformat=unix
:highlight BadWhitespace ctermfg=16 ctermbg=253 guifg=#000000 guibg=#F8F8F0
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
"" Autocompleter settings
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"" FZF settings for eazy search
set grepprg=rg\ --vimgrep\ --smart-case\ --hidden\ --follow
let g:rg_derive_root='true'
silent! nmap <C-P> :Files<CR>
silent! nmap <C-G> :GFiles<CR>
silent! nmap <C-f> :Rg!
silent! nmap <C-h> :Rg!<C-R>0<CR>
silent! nmap <leader>u :Rg!<C-R><C-W><CR>
"" Systastic settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_loc_list_height=1
let g:syntastic_python_python_exec = 'python3'
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_python_flake8_args='--ignore=E501'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment