This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim -N --cmd 'set rtp=$VIM,$VIMRUNTIME,$VIM/after' -U NONE -u <(echo 'set rtp+=~/.vim/bundle/vim-signature') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Provides a --files-from option: rgf --files-from=[-|FILELIST] | |
# The list of files to be searched is specified in FILELIST and must be separated by newlines. | |
# If FILELIST is "-", the list is loaded from standard input. | |
# This option may be specified multiple times. | |
# | |
# Note that this affects how the -t option is applied. When --files-from is specified, | |
# -t is used to filter the list of files and then ripgrep searches for PATTERN on the list of filtered files | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! ParJump(dir, ...) | |
" Description: Paragraph jumping to land on non-blank lines | |
" Arguments: | |
" dir = 1 : Search forward for the last line of the current paragraph or first line of the next one | |
" 0 : Search backward for the first line of the current paragraph or last line of the next one | |
" a:1 : Output of visualmode() | |
" TODO: | |
" * Cursor doesn't stay in the same column in Visual mode | |
let l:curr_line = line('.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is a complete solution to map the CapsLock key to Control and Escape without losing the ability to toggle CapsLock | |
; We use two tools here - any remapping software to map CapsLock to LControl and AutoHotkey to execute the following script | |
; This has been tested with MapKeyboard (by Inchwest) | |
; This will allow you to | |
; * Use CapsLock as Escape if it's the only key that is pressed and released within 300ms (this can be changed below) | |
; * Use CapsLock as LControl when used in conjunction with some other key or if it's held longer than 300ms | |
; * Toggle CapsLock by pressing LControl/CapsLock + RControl | |
~*LControl:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! myFunctions#FindAndList() | |
let term = input("Find: /") | |
let v:errmsg = "" | |
if term == "" | |
term = expand('<cword>')) | |
endif | |
if v:errmsg == "" | |
execute "lvimgrep! /" . term . "/ " . fnameescape(expand('%:p')) | |
lopen | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! IListpp() | |
let term = input("IList: /") | |
if term == '' | |
let term = expand('<cword>') | |
endif | |
let v:errmsg = '' | |
redir =>slist | |
exe 'ilist /' . term | |
redir END | |
if v:errmsg == '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! ScrollBind(...) | |
" Description: Toggle scrollbind amongst window splits | |
" Arguments: 'mode' ( optional ) If not given, toggle scrollbind | |
" = 0 - Disable scrollbind | |
" 1 - Enable scrollbind | |
let l:curr_bufnr = bufnr('%') | |
let g:scb_status = ( a:0 > 0 ? a:1 : !exists('g:scb_status') || !g:scb_status ) | |
if !exists('g:scb_pos') | let g:scb_pos = {} | endif | |
let l:loop_cont = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! MethodJump( dir, pos ) | |
" Description: Jump to next/previous start/end of method | |
" Arguments: | |
" dir = 'next' - Jump to next instance | |
" 'prev' - Jump to previous instance | |
" pos = 'start' - Jump to start of method | |
" 'end' - Jump to end of method | |
let curr_search = @/ | |
let curr_hlsearch = &hlsearch | |
let curr_wrapscan = &wrapscan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Preserve( command ) | |
" Description: Function to execute commands without modifying the original settings like cursor position, search string etc. | |
" Save last search, and cursor position. | |
let currview = winsaveview() | |
" Do the business | |
silent! execute a:command | |
" Restore previous search history, and cursor position | |
call winrestview( currview ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! FoldText() | |
" Description: Folding configuration | |
let nucolwidth = &fdc + &number*&numberwidth | |
let winwidth = winwidth(0) - nucolwidth - 3 | |
let foldlinecount = foldclosedend(v:foldstart) - foldclosed(v:foldstart) + 1 | |
let dashtext = strpart(string(v:folddashes),1,len(string(v:folddashes))-2) | |
let foldinfo = "+" . dashtext . " Fold: " . string(v:foldlevel) . ", " . string(foldlinecount) . " lines " | |
let firstline = strpart(getline(v:foldstart), 0 , winwidth - len(foldinfo)) | |
let fillcharcount = winwidth - len(firstline) - len(foldinfo) | |
return firstline . repeat(" ",fillcharcount) . foldinfo |
NewerOlder