Skip to content

Commit

Permalink
clean things up, get a new slimmed down vimrc
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Miller <[email protected]>
  • Loading branch information
maxamillion committed Apr 24, 2020
1 parent 78f3a28 commit a2b81da
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 60 deletions.
22 changes: 0 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,6 @@ run it.

bash ~/dotfiles/bootstrap.sh

Vim
---

For `vim`_ I use the `vimified`_ config distro because it's simple, it does
everything I want, is easy to use, and I'm really lazy.

My modifications to the default vimified setup are are contained in the
``local.vimrc`` and ``after.vimrc`` files in this repository. The following is
how I set it all up including installing `vimified`_, and then symlink these
files into ``~/vimified/``.

I also install `powerline`_'s `patched fonts`_ to supplement the `airline`_
config that comes with vimified.

Again, feel free to read the script if you're curious what it's doing. Otherwise
just run it.

::

bash ~/dotfiles/bootstrap-vim.sh

Notes
-----
Expand All @@ -55,8 +35,6 @@ that others might find useful in it's own right then I'm happy to have shared.

.. _vim: http://www.vim.org/
.. _Ansible: https://www.ansible.com/
.. _vimified: https://github.com/zaiste/vimified
.. _powerline: https://github.com/powerline/powerline
.. _airline: https://github.com/vim-airline/vim-airline
.. _workstation setup: https://github.com/maxamillion/maxible
.. _patched fonts:
Expand Down
3 changes: 0 additions & 3 deletions bootstrap-vim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@
#ln -s ~/dotfiles/after.vimrc ~/vimified/after.vimrc
#vim +BundleInstall +qall

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim



63 changes: 41 additions & 22 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
#!/bin/bash

# Ensure the needed dirs exist
mkdir -p ~/.config/{dunst,i3,i3status,fontconfig}
mkdir -p ~/.config/fontconfig/conf.d
mkdir ~/.tmuxinator
mkdir ~/.ptpython
mkdir ~/.fonts
mkdir ~/.ssh/
mkdir_if_needed() {
if [[ ! -d $1 ]]; then
mkdir -p $1
fi
}

mkdir_if_needed ~/.config/{dunst,i3,i3status,fontconfig}
mkdir_if_needed ~/.config/fontconfig/conf.d
mkdir_if_needed ~/.tmuxinator
mkdir_if_needed ~/.ptpython
mkdir_if_needed ~/.fonts
mkdir_if_needed ~/.ssh
mkdir_if_needed ~/.vimundo

# Symlink the conf files
ln -s ~/dotfiles/snclirc ~/.snclirc
ln -s ~/dotfiles/dunstrc ~/.config/dunst/dunstrc
ln -s ~/dotfiles/i3-config ~/.config/i3/config
ln -s ~/dotfiles/i3status-config ~/.config/i3status/config
ln -s ~/dotfiles/redshift.conf ~/.config/redshift.conf
ln -s ~/dotfiles/tmux.conf ~/.tmux.conf
ln -s ~/dotfiles/tmuxinator-wm.yml ~/.tmuxinator/wm.yml
ln -s ~/dotfiles/screenrc ~/.screenrc
ln -s ~/dotfiles/gitconfig ~/.gitconfig
ln -s ~/dotfiles/inputrc ~/.inputrc
ln -s ~/dotfiles/ptpython_config.py ~/.ptpython/config.py
ln -s ~/dotfiles/ssh_config ~/.ssh/config
ln -s ~/dotfiles/Xresources ~/.Xresources
ln -s ~/dotfiles/bashrc ~/.bashrc
symlink_if_needed() {
if [[ ! -h $2 ]]; then
ln -s $1 $2
fi
}
symlink_if_needed ~/dotfiles/snclirc ~/.snclirc
symlink_if_needed ~/dotfiles/dunstrc ~/.config/dunst/dunstrc
symlink_if_needed ~/dotfiles/i3-config ~/.config/i3/config
symlink_if_needed ~/dotfiles/i3status-config ~/.config/i3status/config
symlink_if_needed ~/dotfiles/redshift.conf ~/.config/redshift.conf
symlink_if_needed ~/dotfiles/tmux.conf ~/.tmux.conf
symlink_if_needed ~/dotfiles/tmuxinator-wm.yml ~/.tmuxinator/wm.yml
symlink_if_needed ~/dotfiles/screenrc ~/.screenrc
symlink_if_needed ~/dotfiles/gitconfig ~/.gitconfig
symlink_if_needed ~/dotfiles/inputrc ~/.inputrc
symlink_if_needed ~/dotfiles/ptpython_config.py ~/.ptpython/config.py
symlink_if_needed ~/dotfiles/ssh_config ~/.ssh/config
symlink_if_needed ~/dotfiles/Xresources ~/.Xresources
symlink_if_needed ~/dotfiles/bashrc ~/.bashrc
symlink_if_needed ~/dotfiles/vimrc ~/.vimrc

if [[ ! -f ~/.vim/autoload/plug.vim ]]; then
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim;
vim +PlugInstall! +qall
fi

# This doesn't appear to be necessary, but keep it around just in case
#ln -s ~/dotfiles/sshrc ~/.ssh/rc
#link_if_needed ~/dotfiles/sshrc ~/.ssh/rc

# Set perms on ~/.ssh/config
chmod 0600 ~/dotfiles/ssh_config
restorecon -Rvv ~/.ssh
29 changes: 16 additions & 13 deletions vimrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
""""""""""""""""""""""""""" BEGIN VIM PLUG
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
Plug 'Glench/Vim-Jinja2-Syntax'
Plug 'nathanaelkane/vim-indent-guides'
Expand All @@ -11,12 +8,16 @@ Plug 'scrooloose/syntastic'
Plug 'sjl/badwolf'
Plug 'junegunn/vim-easy-align'
Plug 'tpope/vim-endwise'

" Initialize plugin system
Plug 'pearofducks/ansible-vim'
call plug#end()
""""""""""""""""""""""""""" END VIM PLUG

""""""""""""""""""""""""""" BEING GENERAL SETTINGS
" tell it to use an undo file
set undofile
" set a directory to store the undo history
set undodir=$HOME/.vimundo/

" fuck the arrow keys
noremap <left> <nop>
noremap <up> <nop>
Expand All @@ -27,6 +28,7 @@ noremap <right> <nop>
map Y y$
command! W :w
command! Q :q

set modelines=0
set relativenumber
Expand All @@ -50,8 +52,8 @@ let g:indent_guides_exclude_filetypes = ['help', 'nerdtree']
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=238
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=236
au VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=238
au VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=236

""" Syntastic
let g:syntastic_check_on_wq = 0
Expand All @@ -71,14 +73,15 @@ cnoreabbrev SR SyntasticReset
cnoreabbrev AR AirlineRefresh
cnoreabbrev SP set paste


""" Random filetype settings
au BufRead,BufNewFile *.adoc set filetype=asciidoc
autocmd BufNewFile,BufRead *.j2,*.jinja,*.jinja2 set ft=jinja
autocmd FileType python setlocal expandtab sw=4 sts=4 ts=8
autocmd FileType yaml setlocal expandtab sw=2 sts=2 ts=4
autocmd FileType ruby setlocal expandtab sw=2 sts=2 ts=4
autocmd FileType go setlocal ts=4 sts=4 sw=4 noexpandtab
au BufRead,BufNewFile *.j2,*.jinja,*.jinja2 set ft=jinja
au BufRead,BufNewFile */playbooks/*.yml,*/roles/*.yml,*/ansible_collections/*.yml set filetype=yaml.ansible
au FileType python setlocal expandtab sw=4 sts=4 ts=8
au FileType sh setlocal expandtab sw=4 sts=4 ts=8
au FileType yaml setlocal expandtab sw=2 sts=2 ts=4
au FileType ruby setlocal expandtab sw=2 sts=2 ts=4
au FileType go setlocal ts=4 sts=4 sw=4 noexpandtab

" Some webfonts don't handle this well which screws up ssh (hterm) on ChromeOS
set showbreak=>
Expand Down

0 comments on commit a2b81da

Please sign in to comment.