Skip to content

Instantly share code, notes, and snippets.

@kitmenke
Last active March 23, 2018 14:04
Show Gist options
  • Save kitmenke/870c33f0ae97cf6f4252 to your computer and use it in GitHub Desktop.
Save kitmenke/870c33f0ae97cf6f4252 to your computer and use it in GitHub Desktop.
Linux server setup for vim with python
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'terryma/vim-multiple-cursors'
" Plug 'davidhalter/jedi-vim'
" Plug 'nvie/vim-flake8'
call plug#end()
" indent using four spaces
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set backspace=indent,eol,start
" make shift tab unindent (originally ctrl+d)
imap <S-Tab> <C-d>
" turn on line numbers
set number
" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype indent plugin on
"syntax highlighting
syntax on
set ruler
set nowrap
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" Press ctrl+r to do find replace
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
" Press ctrl+p to search files like sublime
noremap <C-p> :FZF<enter>
# create ssh keys with puttygen
# store ssh password in keepass
# install python
# ?
# install easy_install globally
# ? sudo apt-get install easy_install ?
# install pip globally
sudo easy_install pip
# install virtualenv and virtualenvwrapper
sudo pip install virtualenv virtualenvwrapper
# Add the following to your .bashrc
# export WORKON_HOME=$HOME/.virtualenvs
# export PROJECT_HOME=$HOME/someproject <---- customize this
# source /usr/local/bin/virtualenvwrapper.sh
# install vim8 (otherwise I was getting errors using jedi-vim)
sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim
# install pathogen
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# install jedi
pip install jedi
# install vim-flake8
pip install flake8
# install jedi-vim and vim-flake8
git clone --recursive https://github.com/davidhalter/jedi-vim.git ~/.vim/bundle/jedi-vim
git clone https://github.com/nvie/vim-flake8 ~/.vim/bundle/vim-flake8
# create ~/.vimrc
" should go in ~/.vim/ftplugin/python.vim
set tabstop=4
set shiftwidth=4
git config --global user.name "First Last"
git config --global user.email "[email protected]"
# Source: https://coderwall.com/p/euwpig/a-better-git-log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
# Source: http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
git config --global alias.ll "log --pretty=format:\"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]\" --decorate --numstat"
git config --global alias.s "status --short"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment