Giter Club home page Giter Club logo

dotfiles's Introduction

Dotfiles

Install with:

git clone git://github.com/jonaz/dotfiles.git jonaz-dotfiles
cd jonaz-dotfiles
./install

Common Vim commands

:Gbrowse - Open file on github in browser
:Gmove   - move the file to another location. / means repo root. no / means relative to file current locaation.
:Gstatus - show git status
,c<space>- Toggles inline comments
:windo diffthis - diff two open splits

nvim-surround

Old text                    Command         New text
surr*ound_words             ysiw)           (surround_words)
*make strings               ys$"            "make strings"
[delete ar*ound me!]        ds]             delete around me!
remove <b>HTML t*ags</b>    dst             remove HTML tags
'change quot*es'            cs'"            "change quotes"
<b>or tag* types</b>        csth1<CR>       <h1>or tag types</h1>
delete(functi*on calls)     dsf             function calls

search replace multiple files in vim

:args `grep -r -l ‘I hate vim’ .`
:argdo %s/I hate vim/I love vim/g | update

FZF

CTRL-t past selected stuff to command line
CTLR-R paste from bash history to command line
ALT-c cd into selected directory

Vim and system clipboard

"+p - paste from system clipboard
"+y - copy to system clipboard

Folding

zf - folds marked code
zo - open fold
zc - close fold
zR - open all folds
zM - close all folds
za - toggle fold under cursor

Solve conflicts

:Gdiff
dp (when you are in one of the branches, not the middle window)

git in vim

:Gwrite
:Gcommit
:Gpush
:Gpull
:Gread - do a git checkout of current file. 
:Gremove
:Gmove 
<Leader>gac :Gcommit -a -m ""
<Leader>gc :Gcommit -m ""
<Leader>gs :Gstatus
<Leader>gb :Gblame

Windows

:wa - save all open windows
:qa - close all open windows
ctrl-w o - close all windows except current

ctrlp

ctrl-p - search for file/path
ctrl-d - switch mode from path to file when searching
F5 - refresh cached filelist

vdebug

  • <F5>: start/run (to next breakpoint/end of script)
  • <F2>: step over
  • <F3>: step into
  • <F4>: step out
  • <F6>: stop debugging
  • <F7>: detach script from debugger
  • <F9>: run to cursor
  • <F10>: toggle line breakpoint
  • <F11>: show context variables (e.g. after "eval")
  • <F12>: evaluate variable under cursor
  • :Breakpoint <type> <args>: set a breakpoint of any type (see :help VdebugBreakpoints)
  • :VdebugEval <code>: evaluate some code and display the result
  • <Leader>e: evaluate the expression under visual highlight and display the result

Git commands

make pull request of specific commit.

git remote add upstream <git repository>
git remote update 
git checkout -b upstream upstream/master
git cherry-pick <SHA hash of commit>
git push origin upstream

Remove locally cached remote branches.

git fetch --prune

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.