dotfiles
Personal dotfiles
Cloining / replicating
git clone --recursive https://github.com/theo4u/dotfiles.git
Configuration / Automation
-
Setup Mac importing, just simply run
./setup-mac.sh
, which run through the following sequence
- check if brew is installed, install it
- Oh my Zsh installation
- link dotfiles to home directory
- install packages from
Brewfile
- run through mac default configurations (hide/show dock)
-
Syncing Files keeping files updated for dotfiles and brew installed packages
-
cd ~/dotfiles
commit the changes
- for keeping track of installed brew packages, using a git hook to auto update and commit
Brewfile
(no need to think of this)
- then
git push
to push the changes and the auto committed Brewfile
- For vim plugin syncing which is my main focus check below
GIT
Git aliases like
-
gp
for git pull
-
gpush
for git push
-
gco branchname
for git checkout branchname
-
gcb branchname
for git checkout -b branchname
-
gbd branchname
for git branch -D branchname
- etc. more in .bash_profile
Export secure Content
To export secure content like NPM_TOKEN
you can create ~/.bash_profile_secure
and it will be automatically exported. check .bash_profile
VIM
Adding Plugins via Pathogen
cd ./.vim/bundle
git submodule add http://github.com/tpope/vim-fugitive.git
Using git hook to auto commit the submodule added using the repo-name
like so added ${repo_name} plugin
. So, anytime we decide to push we can push the new update
Managing Plugins
Single Update
cd ~/.vim/bundle/${pluginName}
git pull origin master
All Update
git submodule foreach git pull origin master
Remove Update
cd ~/.vim/bundle
git submodule deinit <submodule-name>
git rm <submodule-name>
Using git hook to auto commit the submodule after triggering git submodule update
automatically too (keeping check of the current state of submodules)
- removed using the
repo-name
like so removed ${repo_name} plugin
.
- any submodule changes like so
Updated Plugins
.
So, anytime we decide to push we can push the new update
Term/ITerm theme
Profile requires roboto powerline font to be installed. See https://github.com/powerline/fonts#quick-installation
VIM Cheat sheet
VIM SESSION
-
:mks ~/sessions/name of project.vim
: The next time youre ready to start working on that project, source that session file within vim :source ~/sessions/rooster.vim
Or open it when you run vim in terminal using the**-S**flag: vim -S ~/.vim/sessions/rooster.vim
Boom. Everything will be exactly as you left it: the working directory, your windows, splits, andbuffers, and any options youve:set. When the cycle repeats as you rearrange the furniture, just overwite the old session by using:mks!
.
VIM TABS
- gt(or:tabn) to go to next tab
- gT(or:tabpor:tabN) to go to previous tab
- #gt(or:tabn #) to go to #th tab
- :tabrto go to first tab
- :tablto go to last tab
- :tabmto move the current tab to the last position
- :tabm #to move the current tab to the #th position
Goto Definition using g
Place the cursor on any variable in your program.
- gdwill take you to the local declaration.
- gDwill take you to the global declaration.
- gsearch for the word under the cursor (like, butg*on 'rain' will find words like 'rainbow').
- g#same as g* but in backward direction.
- gggoes to the first line in the buffer (or provide a count before the command for a specific line).
- Ggoes to the last line (or provide a count before the command for a specific line).
- gfwillgo to the file under the cursor
- g]and other commands willjump to a tag definition(a tag can be a function or variable name, or more).
- gf- Edit existing file under cursor in same window
- C-Wf- Edit existing file under cursor in split window
- C-WC-F- Edit existing file under cursor in vertically split window
- C-Wgf- Edit existing file under cursor in new tabpage
Surround
http://www.futurile.net/2016/03/19/vim-surround-plugin-tutorial/