See https://github.com/romainl/vim-devdocs for an up-to-date version.
Look up keywords on https://devdocs.io from Vim
Use :DD
without argument to look up the word under the cursor, scoped with the current filetype:
See https://github.com/romainl/vim-devdocs for an up-to-date version.
Use :DD
without argument to look up the word under the cursor, scoped with the current filetype:
Suppose you have weird taste and you absolutely want:
" MIT License | |
" Copyright (c) 2017 romain Lafourcade | |
" Permission is hereby granted, free of charge, to any person obtaining a copy | |
" of this software and associated documentation files (the "Software"), to deal | |
" in the Software without restriction, including without limitation the rights | |
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
" copies of the Software, and to permit persons to whom the Software is | |
" furnished to do so, subject to the following conditions: |
" Use a bunch of standard UNIX commands for quick an dirty | |
" whitespace-based alignment | |
function! Align() | |
'<,'>!column -t|sed 's/ \(\S\)/ \1/g' | |
normal gv= | |
endfunction | |
xnoremap <silent> <key> :<C-u>silent call Align()<CR> |
This is an intuitive command-line mode mapping to insert the current line.
It is no longer needed since 8.0.1787 because the feature is now built-in. See :help c_ctrl-r_ctrl-l
.
hi u0 ctermbg=red | |
hi u1 ctermbg=yellow | |
hi u2 ctermbg=cyan | |
hi u3 ctermbg=darkgreen | |
hi u4 ctermbg=magenta | |
hi u5 ctermbg=darkred | |
let all_nicks = [] | |
function! IsolateNicks(key, val) |
What people refer to as a "macro" is often actually a "recording".
You press qa
to start recording your commands into register a
, you do your thing, you stop your recording with q
, and you play that recording back with @a
.
Yes, what you just recorded is a macro, but macros are not necessarily recorded or even stored in registers.
autocmd BufNewFile,BufRead *.foo set filetype=html
BufNewFile,BufRead
is the list of events that trigger this autocommand.*.foo
is the pattern we want to match against the data returned by the event.set filetype=html
is the command we want to execute when the pattern matches the data returned by the event.You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.
autocmd FileType <filetype> setlocal makeprg=<external command>
This autocommand tells Vim to use <external command>
when invoking :make %
in a <filetype>
buffer. You can add as many similar lines as needed for other languages.