Did you ever wish you could repeat the last edit an arbitrary number of times without mashing the .
key?
Well now you can.
......
" jump to next non-empty line | |
nnoremap <key> :<C-u>call search('^.\+')<CR> | |
" jump to previous non-empty line | |
nnoremap <otherkey> :<C-u>call search('^.\+', 'b')<CR> | |
" extend visual selection to next non-empty line | |
xnoremap <key> :<C-u>k`\|call search('^.\+')\|normal! <C-r>=visualmode()<CR>``o<CR> | |
" extend visual selection to previous non-empty line |
" markdown : jump to next heading | |
function! s:JumpToNextHeading(direction, count) | |
let col = col(".") | |
silent execute a:direction == "up" ? '?^#' : '/^#' | |
if a:count > 1 | |
silent execute "normal! " . repeat("n", a:direction == "up" && col != 1 ? a:count : a:count - 1) | |
endif |
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.
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.deploy:live: | |
image: 1drop/docker:git | |
stage: deploy | |
when: manual | |
environment: | |
name: production | |
url: https://www.somecustomer.de | |
before_script: | |
- eval $(ssh-agent -s) | |
- ssh-add <(echo "$SSH_PRIVATE_KEY") |
Suppose you have weird taste and you absolutely want:
" Background here: https://gist.github.com/romainl/047aca21e338df7ccf771f96858edb86 | |
" with help from https://github.com/teoljungberg | |
function! CCR() | |
let cmdline = getcmdline() | |
let filter_stub = '\v\C^((filt|filte|filter) .+ )*' | |
command! -bar Z silent set more|delcommand Z | |
if getcmdtype() !~ ':' | |
return "\<CR>" | |
endif |
This is an example of hosting standalone web front-end (web) and data API (api) applications under the same domain via Nginx (acting as a reverse proxy) and Docker, where HTTP requests starting with example.com/graphql
and example.com/login/*
are being redirected to http://api:3000 and everything else under the same domain is going to be passed to http://web:3000.
.
├── /nginx.sites/ # Server configuration for each of web apps
├── /nginx.snippets/ # Nginx code snippets