Skip to content

pouyas-github/dotfiles

 
 

Repository files navigation

My own (Neo)Vim configuration which focuses on JS(React, Vue, stage-0, TS, Flow), CSS(and styled-components), GraphQL and GO, however also works with C# and Python. Configuration is based on Tmux, iTerm2, OSX but I also use it on Ubuntu. I use Alt and CMD for some key mappings, so it's more suitable for Mac+iTerm.

Vim

ZSH

Installation

1. Install required binaries

  1. Have (Neo)Vim and Git installed ofcourse
  2. Tmux (plugins: https://github.com/sourcesoft/my-long-list/blob/master/.tmux.conf)
  3. If using OSX: brew install reattach-to-user-namespace
  4. Rainbarf (https://github.com/creaktive/rainbarf)
  5. Oh My ZSH (https://github.com/robbyrussell/oh-my-zsh)
  6. If you're running OSX install iTerm and Dash.app (https://kapeli.com/dash)
  7. GO (https://golang.org/doc/install)
  8. The Silver Searcher (https://github.com/ggreer/the_silver_searcher)
  9. Free Inconsolata font

2. Backup your old configuration and get new ones

  1. Backup the old one first: mv ~/.vimrc ~/.vimrc.bak
  2. Replace it: wget -O ~/.vimrc https://raw.githubusercontent.com/sourcesoft/my-long-list/master/.vimrc
  3. NeoVim uses XDG configuration: ln -s ~/.vimrc ~/.config/nvim/init.vim
  4. Vim uses old .vimrc location so there's no need to create symlink.
  5. Copy other config files in the repository like .bash_profile, .gitconfig, .tern-config, .tmux.conf, .zshrc, .eslintrc.js, prettierrc, .gitignore, .prettierignore and configure more if feel comfortable.

3. Download and install more

  1. Before opening (Neo)Vim:
  • Install necessary global node packages by running npm install -g typescript neovim
  • Install global node packages for eslint npm i -g eslint eslint-config-airbnb eslint-config-airbnb-base eslint-config-prettier eslint-plugin-import eslint-plugin-prettier prettier eslint-import-resolver-webpack eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-redux-saga redux-saga webpack babel-eslint or install them in the project directory as a dev dependency.
  • Open tmux running tmux and install tmux plugins with Prefix + I
  • Install vim-plug: https://github.com/junegunn/vim-plug
  • Download and install Knack Nerd Font from here and configure iTerm2 to use it.
  • Install plugins by running vim +PlugInstall +qall or nvim +PlugInstall +qall in terminal
  1. Open (Neo)Vim and:
  • Run :UpdateRemotePlugins in vim at the end.
  • Open NeoVim(Vim) and run :GoInstallBinaries and then :TmuxLine
  • Learn key bindings by reading this file

Mappings and Environment

It's much easier to use right CMD or Alt instead of reaching out escape. I also use Caps Lock for Control, since it's closer and easier to hit.

  • Escape -> Right CMD or Right Alt
  • Control -> Caps Lock

Tools to setup the key bindings:

Hex code mappings for iTerm:

  • cmd-o: 0x01 0x29 --- tmux next session
  • cmd-i: 0x01 0x28 --- tmux previous session
  • cmd-j: 0x2C 0x73 0x6A --- vim jump page down
  • cmd-k: 0x2C 0x73 0x6B --- vim jump page up
  • cmd-m: 0x2C 0x6D --- vim quickfix previous
  • cmd-n: 0x2C 0x6E --- vim quickfix next
  • cmd-n: 0x2C 0x71 --- vim quickfix toggle
  • cmd-p: 0x2C 0x70 --- vim run tmux command
  • cmd-r: 0x2C 0x72 --- vim run last tmux command
  • cmd-f: 0x2C 0x66 --- vim toggle fullscreen
  • cmd-;: 0x2C 0x3B --- list buffers
  • cmd-a: 0x2C 0x61 --- search current buffer subdirectory
  • cmd-s: 0x2C 0x73 0x73 --- run ALEFix
  • ctrl-space: 0x2C 0x76 --- lookup Dash.app docs

Troubleshooting to get NeoVim, iTerm and Tmux all work together smoothly:

Tools as a developer

  • NeoVim / vimrc / ag - Can't live without ya'll, not even a day.
  • iTerm2 / zsh / tmux - Performant terminal and shell everywhere.
  • SourceTree - I can't remember all those weird hard to memorize git commands, so this is my GUI.
  • Transmit - I'm using it for what it is and It's got everything I want.
  • Paw - Advanced REST client for testing my backend
  • Little Snitch - Sometimes I need to monitor I/O of an application I'm developing.
  • Charles - Monitoring using all the tools even the ones I have no idea what they are.
  • Fritzing - Easily design electronic circuits for Arduino in no time.
  • OsmondCocoa - Sometimes I need to build a ready to print for some home-made circuits.

About

OSX, Ubuntu compatible dotfiles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 79.5%
  • Shell 14.7%
  • JavaScript 5.8%