Skip to content

Instantly share code, notes, and snippets.

@morten-olsen
Last active June 20, 2017 20:14
Show Gist options
  • Save morten-olsen/55bda69e6fe9eb71eac7 to your computer and use it in GitHub Desktop.
Save morten-olsen/55bda69e6fe9eb71eac7 to your computer and use it in GitHub Desktop.
My "get up and running in VIM" script
sudo rm -R ~/.vim
cat > ~/.vimrc << EOF
set nu
execute pathogen#infect()
syntax on
filetype plugin indent on
set t_Co=256
set mouse=a
set number
:let mapleader = ","
map <leader>af :FufFile<CR>
map <leader>ad :FufBuffer<CR>
nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>
nnoremap <Leader><Space> :Goyo<CR>
" let g:zenmode_background = "dark"
" let g:zenmode_colorscheme = "solarized"
" let g:zenmode_font ="Cousine 12"
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
set mouse+=a
if &term =~ '^screen'
" tmux knows the extended mouse mode
set ttymouse=xterm2
endif
function! g:goyo_before()
silent !tmux set status off
set noshowmode
set noshowcmd
endfunction
function! g:goyo_after()
silent !tmux set status on
set showmode
set showcmd
set background=dark
colorscheme solarized
endfunction
let g:goyo_callbacks = [function('g:goyo_before'), function('g:goyo_after')]
EOF
cat > ~/.tmux.conf << EOF
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
bind-key C-b source-file ~/.tmux.conf
# Start numbering at 1
set -g base-index 1
# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left ""
set -g status-right "#[fg=green]#H"
#set -g status-right '%a %b %d, %Y %H:%M'
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
#setw -g monitor-activity on
#set -g visual-activity on
# Example of using a shell command in the status line
#set -g status-right "#[fg=yellow]#(uptime | cut -d ',' -f 2-)"
# Highlight active window
set-window-option -g window-status-current-bg red
set -g default-terminal "screen-256color"
EOF
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
git clone https://github.com/vim-scripts/L9.git ~/.vim/bundle/l9
git clone https://github.com/vim-scripts/FuzzyFinder.git ~/.vim/bundle/FuzzyFinder
git clone https://github.com/altercation/vim-colors-solarized.git ~/.vim/bundle/vim-colors-solarized
git clone https://github.com/mattn/emmet-vim.git ~/.vim/bundle/emmet-vim
git clone https://github.com/junegunn/goyo.vim.git ~/.vim/bundle/goyo
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
git clone https://github.com/leafgarland/typescript-vim.git ~/.vim/bundle/typescript-vim
git clone https://github.com/Shougo/vimproc.vim.git ~/.vim/bundle/vimproc.vim
pushd ~/.vim/bundle/vimproc.vim
make
popd
git clone https://github.com/Quramy/tsuquyomi.git ~/.vim/bundle/tsuquyomi
git clone https://github.com/vim-scripts/AutoComplPop.git ~/.vim/bundle/AutoComplPop
curl -L https://gist.githubusercontent.com/morten-olsen/55bda69e6fe9eb71eac7/raw/install.sh | sh -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment