Skip to content

Instantly share code, notes, and snippets.

Avatar

Adrien Fabre statox

View GitHub Profile
@statox
statox / SetVisualBlock.vim
Created May 23, 2019
A vimscript function to set a visual block selection
View SetVisualBlock.vim
" Inspired by @ Christian Brabandt on this question https://vi.stackexchange.com/q/20066/1841
function! SetVisualBlock(start, end)
" Trigger visual block mode
execute "norm! \<C-v>\<Esc>"
" Set the marks
call setpos("'<", [ 0, a:start[0], a:start[1] ])
call setpos("'>", [ 0, a:end[0], a:end[1] ])
@statox
statox / actionlist.vim
Created Nov 6, 2018 — forked from zchee/actionlist.vim
IdeaVim actionlist
View actionlist.vim
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
View CoherentIncrement.vim
" This is a test answer for https://vi.stackexchange.com/q/17423/1841
" <C-a>
nnoremap <Leader>a :call CoherentIncrement(1)<CR>
" <C-x>
nnoremap <Leader>b :call CoherentIncrement(0)<CR>
function! CoherentIncrement(inc)
let save_cursor = getcurpos()
View MakeNewLine
function! MakeNewLine()
if getline(line('.')) =~# "^\s*>.*$"
normal! o>
else
normal! o
endif
endfunction
inoremap <cr> <C-o>:call MakeNewLine()<cr>
@statox
statox / multimedia.sh
Last active Apr 9, 2017
Install multimedia system
View multimedia.sh
## Install seedbox system for several users with
## Transmission
## Sonarr
## Headphones
##
## Debian 8
# References:
# DOCKER INSTALL - https://docs.docker.com/engine/installation/linux/debian/
# SHIPYARD (docker management) - https://github.com/shipyard/shipyard
@statox
statox / pinFold.vim
Last active Nov 23, 2016
Playing with vim folds
View pinFold.vim
augroup pythonFold
autocmd BufReadPre *.py setlocal foldmethod=indent
autocmd CursorMovedI *.py call PinFold()
autocmd CursorMoved *.py call PinFold()
augroup END
function! PinFold()
" save current position
let saveCursor = getcurpos()
View random_wallpaper.sh
#!/bin/bash
# Get a wallpaper randomly from different subreddits
# Works with Gnome3
# Put it in a crontab
# List of the subbreddit to use (if the variable is empty
# r/Wallpaper will be used
SUBS=( Wallpaper WQHD_Wallpaper WidescreenWallpaper wallpaperdump )
# Directory containing the background
@statox
statox / tmux_local_install.sh
Last active Sep 15, 2015 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
View tmux_local_install.sh
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
View grok_vi.mdown

Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question: what is your most productive shortcut?

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
You can’t perform that action at this time.