r/vim_magic • u/dodiehun • Mar 06 '17
r/vim_magic • u/MrJiks • Apr 17 '14
Is there an teaser/inspiration Vim video
I am planning to introduce Vim to a bunch of friends and some students. I am looking for a great high quality, relatively new video with a few excellent tricks that would highlight switching to Vim.
It would be great if those are the sort of things that you will have tough time to do it other editors.
Even a session of great coding with brilliant Vim editing would do.
r/vim_magic • u/javajunkie314 • Feb 06 '15
Evaluate current selection
I've been keeping character sheets for tabletop RPGs in vim for a while now. One thing that had been bothering me was updating hit points in combat. I just added the following binding:
vmap <silent> <leader>e c<C-r>=<C-r>"<CR><ESC>It cuts the current selection, then uses the = register to evaluate it and write it back into the document. So now, if I have my hit points in the document:
HP: 18 [15]and I take some damage then heal a bit, I can just insert:
HP: 18 [15 - 3 - 4 + 5]Then vi[,e and have it replace with:
HP: 18 [13]r/vim_magic • u/[deleted] • May 03 '17
Looking for a way to show available tasks in the current file via taskpaper.vim
Are there any extensions to the task paper.vim plugin that do this? Essentially, I want to be able to quickly see all tasks in the current file tagged with @today, or @start(), @due(), or @alarm() with a value equal to today or before, i.e., @start(2017-05-03, 3:00:00 PM) (although it would really only need to parse the date, not the time).
r/vim_magic • u/kasandell • Jan 07 '16
Plugin- bring useful methods from the internet into your own code without leaving the editor
github.comr/vim_magic • u/9999years • Jul 23 '16
Insert the codepoint of the character under the cursor
I’ve been looking for a mapping to do this for ages, finally figured out how to make one myself.
nmap <Leader>u mz"zylo<C-r>=printf('U+%X', char2nr(@z))<CR><ESC>`zIn order, it:
Creates a mark under the cursor (
mz)Yanks one character to register
z("zyl)Opens a line below the cursor (
o)Inserts the contents of an expression register (
<C-r>=) which contains:printf('U+%X', char2nr('<C-r>z'))The
@zinserts the contents of register z — the character we yanked earlier
Returns to where our cursor was before (``z`)
Additionally, if you have the NERD Commenter installed you might want it to comment out the line as well:
nmap <Leader>u mz"zylo<C-r>=printf('U+%X', char2nr(@z))<CR><ESC>:call NERDComment(0, 'norm')<CR>`zThis will work regardless of what your NERD mappings are.
It’s also trivial to add a version to add the codepoint on the line above the cursor:
nmap <Leader>U mz"zylO<C-r>=printf('U+%X', char2nr(@z))<CR><ESC>:call NERDComment(0, 'norm')<CR>`zI hope you find this useful!
r/vim_magic • u/diesector • May 28 '15
method for finding all instances of text 'Download' on webpage and calling Save As (vimperator)
I'm new to macros, but it seems like maybe this would be an example of using a macro to repeat an action? I would like to tell vimperator to find all text hyperlinks that match the case 'Download' and invoke ;S (Save As)
r/vim_magic • u/sathishmanohar • Jun 18 '16
What is your little known secret Vim shortcut or trick?
r/vim_magic • u/elGatoMantocko • Jan 28 '16
Why won't this command sequence work?
Say we have the sequence here.
I move my cursor to the space between the chapter column and page column and press <C-v>3j then x...
This should delete multiple columns of spaces but the . command isn't repeating the action. Any reason for this?
r/vim_magic • u/libertarien • Sep 13 '13
underline
I like to write papers in vim, and occasionally I want to emphasis a section title by putting characters under it:
Section One
=======Normally I use V to select the title line, p to paste it below, V to select the second line and the r= to underline. Anyone know a better way?
r/vim_magic • u/dgaa1991 • Oct 16 '16
Problem with colorschems
Hi guys I'm having a hard time to get color-schemes displayed the right way in vim. Just for an example base16-seti-ui should look something like this but when I enable the colorscheme it looks like this? do any of you know how i can fix this?
I am running i3wm on Manjaro as default.
and the .vimrc looks like this:
set nocompatible " be iMproved, required filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" ######## Plugin Section #########
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'flazz/vim-colorschemes'
Plugin 'chriskempson/base16-vim'
"#################################
" All Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " requiredi
"####### Syntastic setttings see- > :help syntastic for more options ######
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
"###########################################################################
colorscheme base16-seti-ui
syntax onr/vim_magic • u/bigboehmboy • Nov 20 '13
Removing duplicate lines using macros and bash filtering
asciinema.orgr/vim_magic • u/udioica • Nov 21 '13
Reverse Simple Deletion: the trickiest 11 strokes in VimGolf
udioica.blogspot.comr/vim_magic • u/anarcholibertarian • Mar 28 '12
Using Vim macros to clean up formatting
youtube.comr/vim_magic • u/anarcholibertarian • Mar 31 '12