Developer
São Paulo, Brazil
Hello there, I’m Kassio Borges. I’m a Brazilian Developer, currently working mainly with Ruby and Rails at Plataformatec. So I do use vim and neovim for coding, noting and draft ideas. I’ve been using vim for almost a decade, at the beginning I used it more for work on text files on servers, nowadays I use it for almost every text editing I have to do.
First of all, I’d like to tell I care about my vim’s configurations a lot, however I also love to try new configurations, so my config files change a lot. My vim repo, on github, has more than a thousand commits, and it exists only for 4 years.
Some configs change a lot on my files: key mappings and plugins loading. I’m always trying new plugins, and also trying to live without some plugins. Today, I’m using 26 plugins on my configs, some of them only for neovim.
I have one config that I’d love to be default in vim, I use !
to search the
current word/selection without move the cursor. This is awesome to look
around where the current word/selection is being used, also to help with
replacing. It’s very common for me to use :s//new-word/g
just after a !
. This
way, before the replacement, I’ll see what’s changing on the file.
Besides that, there are some plugins that I use a lot:
CtrlP
I tried Unite.vim, fzf, and others, however CtrlP, for me, has the best UI in
vim. It’s simple and fast enough with ag
. Sometimes I’d like it to be
faster, but for my current projects, it’s ok.
NERDTree
Sometimes I’m lazy enough to use my mouse. I know, I know… But sometimes I’m just reading code and don’t want to use the keyboard. NERDTree helps a lot with this, because, even in terminal, I just click, click, click and move around the code. Besides that, I like to have a tree view of the project from time to time.
Vim surround
This is the type of plugin that I think should be default on vim. I don’t know when I use, but everytime I try to live without it I can’t. Vim without surround, for coding, it’s to painful for me.
Vim repeat
This is another example of a plugin that should be default, I don’t recall to use, or when it’s possible to use or not, I just use. And I tried remove it, but, again, my coding day it’s too painful without it.
ultisnips
I’m lazy, snips helps me a lot. And this was my chose, I don’t recall the reason. I tried others, but this one fitted better to my use.
This is a little plugin I created to help me when I want to restart vim
without loose my current window setup. I just run <leader>ss
to save a
session, <leader>sl
to load and <leader>sd
to delete. The plugin manages
the session name and folder for me.
Neomake
As a coder, for me is awesome run the linter all the time I save a file, and Neomake, with neovim, works like a charm for that.
Neoterm
Again, as a coder, and a lazy one, I like to run tests, or little terminal
jobs fast and without leave the editor. So I created this to wrapper the
:terminal
feature of neoterm and run tests, or use a REPL, os just send a
command without much effort.
Syntax plugins
From my 26 plugins, 9 are language syntaxes. Ruby, Rspec, Minitest, HTML, Javascript, Elixir, Markdown and Tomdoc.
I tried a lot of statusline plugins, but I didn’t like anyone so I use a fancy statusline that I configured by myself.
Currently I’m using ocean-next colors, on iTerm2 an neovim/vim. It’s very nice
on neovim with $NVIM_TUI_ENABLE_TRUE_COLOR
enabled.
I already used as leader key \
and ,
, but nowadays I’m using <space>
. It
makes a lot of sense for me to use the biggest key on the keyboard as the leader
one.
Some people already asked my about how to organize vim configs. I like to
organize my configs as personal plugins. I have on my vimrc
/init.vim
only
set
s and some little vim boot configs. All external plugins’s configurations
are on my /plugins
folder. All my custom functions are in /autoload
. This
made my setup easier to maintain and faster to load, because vim doesn’t load my
functions on boot.
I read almost all :help
. I learned a lot reading the source code from the
plugins I use most, like vim-ruby. Vim-casts and Pratical Vim are also a good
place to learn how to improve the vim skills.
I love learn more about regexp and replace techniques, because refactoring large
code bases are hard and this can help a lot. Also, I like to learn about all the
news, so I try to follow every new feature/concept on vim/neovim.
I fell in love with vim few years ago, but it was missing some features. Neovim
brought some of the missing to the table. I just learned that vim 8.0 is back to
the track, bringing channels
and a native plugin manager and I’m really
excited about these new features.
I guess my first plugin as the vim-session_manager
. Writing plugin, for me,
it’s not a vim thing, I’m always trying to get all I can from my tools. With
vim, one way to do this is writing plugins. After writing vim-session_manager
,
I was more comfortable with vim script, so I started write a lot of custom
functions, and other little plugins.
Before neovim I used to use vim+tmux. I had a plugin to send commands to tmux.
But I wasn’t satisfied with that. I’d like something more IDEish. So when neovim
brought :terminal
to the table I saw the opportunity to run tests and other
commands without leave vim, and that was awesome.
I’m currently without many time to work on neoterm, but I’d like to improve its
tests’ statusline feedback. Today it’s done by pattern match, I’d like to
improve it to use the test command status instead, this way we’d have a more
reliable test status on neovim’s statusline.
I went, recently, to the first vim meetup on São Paulo and talked about neovim and vim configurations organization. I really enjoy help people to use better vim/neovim, and I intend to do this again when possible.
function! preserve#preserve(command)
setlocal lazyredraw
let l:search=@/
let last_view = winsaveview()
execute a:command
call winrestview(last_view)
let @/=l:search
redraw
setlocal nolazyredraw
endfunction
This is a snippet that I copied the idea from I don’t know where (I think is
vim wiki). I use this function on many keymappings, and other functions. What it
does is very simple, it runs the given command without move the cursor or the
current window view. I use this, for instance, in the !
mapping that I
mentioned before.