let g:fugitive_summary_format = "%<(16,trunc)%an || %s"
Vim-Fugitive is a great package. Recently I started to use :Glog command a lot to look at range of changes added to a branch after git pull.
:Glog <hash>..<another hash>
By default the command only shows a commit hash and its subject.
I really wanted to see how can I show a commit author name as well.
Vim’s autocmd is very powerful feature.
In my workflow I have many of them including autocmd for BufWrite.
There are rare cases when I want to save file and ignore any autocmd.
To do this you can just save it by:
:noa w
Of course there can be any command after :noa
.
Check :h noa
for more details.
Hi, I didn’t use folding functionality previously at all in any other editors, but after I watched this awesome video by Greg Hurrell I found this Vim feature super useful.
So to start getting all benefits from Vim folding just add this to your .vimrc
:
set foldmethod=indent
set foldlevelstart=1
What these lines do is:
set foldmethod
- setting the folding method. indent
is actually works mostly for all programming
languages. There are other options though (see :h fold-methods
)
hi everyone,
I’m currently using Vim in my day to day work, and if you don’t know I migrated from another perfect editor called Emacs.
It was pretty easy to migrate since I used evil-mode in Emacs but the only library/plugin I miss is dumb-jump which is brilliant because allows you to jump to definition without any CTAGS/GTAGS.
There is brilliant guy Chris Paul who made dim-jump
plugin which does the same as dumb-jump
.
Hey, I’ve just been looking for a good plugin that can help me to configure some VIM variables per project.
For example I want set shiftwidth=2
for my JavaScript project and set shiftwidth=4
for PHP one.
Turned out no plugin needed.
Just put this to your .vimrc
:
silent! so .vimlocal
Now if you put .vimlocal
file to your project root, it will be sourced and “executed”.
silent!
is using to supress warnings when there is no .vimlocal file in a directory.
I’m currently trying to use Vim instead of Emacs and one of important workflow I’ve used to is grepping things in a project.
There are few options:
:vimgrep something **/*
. It’s pretty long to type so I don’t really like it.My config looks like this:
let g:EasyGrepCommand="grep"
let g:EasyGrepRoot="repository"
let g:EasyGrepRecursive = 1
let g:EasyGrepFilesToExclude = "vendor,docker,node_modules"
By default EasyGrep use vimgrep
which is not able to ignore folders as far as I got.