Dotfiles, also include some vim related files.
Some self-defined functions and features.
- git stash
- virtualenv (for python)
- .sourceme.sh
Toggle between long prompt (default) and short prompt (focus mode).
Readline programs now use vi mode!!
Enter visual mode to open editor to edit command.
This is the same as <C-x><C-e>
-
git branch --show-description
- Show description of current branch. Not very usefull...
-
git log -o
/git log -og
-o
for oneline, and-og
for oneline and graph.
-
git ff (number)
- autofixup the last commit if the message is "ff" (or up to 'number' - 1 cocmmits)
Open a file.
Since windows does not know what to do with markdown, it is manually opened in the function.
Remove .*.swp files in the current directory.
Source activate file for python virtualenv. Switch to pipenv instead.
Highlight tool.
Ltcd. Use cd --
to select and cd -n
to go to last n dir.
Search parent directory for matching PREFIX name.
Useful when combining with ls
and cd
.
Combined mkdir and cd.
Cat a file from ~/templates/.
Call this in vim :r!vread <file>
to insert.
Usage: ytd [url] (format)
youtube-dl. Defualt format=mp3
Remember to copy all the content from .vim.
Use vim-plug as plugin manager.
Run vim +PlugInstall
to install plugins and use vim +PlugUpdate
to updates.
A really powerful autocompletion and linting engine.
-
c/c++/obj-c: clangd
sudo apt-get install clang-tools-8 sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100
Check out
https://clang.llvm.org/extra/clangd/Installation.html
for more help. -
python:
pip install jedi pylint --user
-
bash:
npm i -g bash-language-server
- May encounter permission issue due to WSL 1.
-
LaTeX: vimtex is needed. Already in .vimrc.
-
text: language tool. check
https://github.com/languagetool-org/languagetool
Movement:
-
Ctrl-j: move to the next anchor.
-
Ctrl-k: move to the previous anchor.
-
gd: goto definition.
-
gr: show all usage (reference).
-
<leader>k: show document.
-
fuzzy file search.
-
Ctrl-p to search.
-
C-f and C-b to toggle search target.
-
C-r to toggle regex.
-
<leader> to search function definition.
"Leader" is set to '\'.
-
<leader><space>: noh & pclose.
-
<leader>p: toggle paste mode.
- Notice that when paste is on, all the mapping in insert mode will be temporary disabled.
-
<leader>bt: toggle buffer explorer window. (Added by bufexplorer.)
Ctrl:
- [insert mode] ctrl + : map to ctrl + O. For quick commands in insert mode.
SS
:SS
is alias tosyntax sync fromstart
since syntax highlighting is a little bit funky with folding.
- F6 to execute command in current line with current shell.
- c/cpp: save the file and compile with gcc/g++
- LaTeX: save the file and compile with xelatex
- The ctrlp fuzzy file search.