archive-org.com » ORG » R » RUDERICH.ORG

Total: 336

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • coloredstderr (0.2)
    However this creates different runtime behaviour resulting in a different ordering of the output Partial lines no newline also often cause problems coloredstderr handles these cases correctly It was inspired by stderred 2 Similar solutions using LD PRELOAD include stderred 1 but doesn t follow dups I somehow missed it when looking for existing implementations stderred 2 but only hooks write 1 https github com sickill stderred 2 https github com trapd00r stderred coloredstderr is licensed under GPL 3 or later Requirements C99 compiler variable length arrays dynamic linker loader which supports LD PRELOAD e g GNU Linux s or FreeBSD s ld so Supported Systems Tested on GNU Linux FreeBSD and Mac OS X partial support Should work on all POSIX systems which support LD PRELOAD with minor modifications Usage Add the following settings to your shell configuration LD PRELOAD absolute path to libcoloredstderr so COLORED STDERR FDS 2 export LD PRELOAD COLORED STDERR FDS Also see README in tarball Download Current development happens in the git repository also browsable as Gitweb git clone http ruderich org simon coloredstderr coloredstderr git version 0 2 2014 06 22 Fix hook for GNU s error at line not exiting if status

    Original URL path: http://ruderich.org/simon/coloredstderr/ (2016-04-29)
    Open archived version from archive


  • different than c V set statusline P position in file in percent endif MAPPINGS except for plugins see PLUGIN SETTINGS below noremap is used to make sure the right side is executed as is and can t be modified by a plugin or other settings Except for which isn t affected by mappings Easy way to exit insert mode jj is too slow inoremap jk Also for command mode thanks to http github com mitechie pyvim 2010 10 15 cnoremap jk And fix my typos inoremap JK inoremap Jk inoremap jK cnoremap JK cnoremap Jk cnoremap jK Disable arrow keys for all modes except command modes Thanks to James Vega http git jamessan com p etc vim git a summary map map map map imap imap imap imap Also disable arrow keys in command mode use as replacement see below cmap cmap cmap cmap Use as replacement for in command mode Thanks to abstrakt and grayw in vim on Freenode 2010 04 12 21 20 CEST cnoremap cnoremap if has eval Don t move the cursor to the first column for certain scroll commands Thanks to jamessan in vim on Freenode 2011 08 31 02 27 CEST for the nostartofline tip But I can t use nostartofline directly because it also enables that feature for other commands which I don t want Set nostartofline for a single movement function s TemporaryNostartofline movement let l startofline startofline set nostartofline execute normal a movement let startofline l startofline endfunction Thanks to fow in vim on Freenode 2012 02 16 15 38 CET for the idea to use Vim documentation reference help call TemporaryNostartofline C F nnoremap call TemporaryNostartofline C B nnoremap call TemporaryNostartofline C D nnoremap call TemporaryNostartofline C U endif Let Y yank to the end of the line similar to D and C Use yy if you want to yank a line This fixes a weird inconsistency in Vi m nnoremap Y y Write before suspending thanks to deryni in vim on Freenode 2011 05 09 20 02 CEST To suspend without saving either unmap this or use stop Only the current buffer is written thus switching to another buffer works too nnoremap update stop 2 gives more verbose information use it by default Thanks to NCS One in vim on Freenode 2011 08 15 00 17 CEST nnoremap 2 Use to move down a page and to move up one like in mutt Don t use nnoremap so the nostartofline fix see above works nmap nmap Go to next and previous buffer Thanks to elik in vim on Freenode 2010 05 16 18 38 CEST for this idea nnoremap gb bnext nnoremap gB bprevious if has eval But when starting again at the first buffer print a warning which reminds me that I ve already seen that buffer function s NextBuffer Are we currently on the last buffer and moving to the first let l last buffer 0 if bufnr bufnr bufnr 1 let l last buffer 1 endif Go to the next buffer if l last buffer bnext Go to the first buffer silent is necessary or the following message won t be displayed because it s overwritten by the status message displayed when entering a buffer else silent bnext echohl WarningMsg echo Starting again at first buffer echohl None endif endfunction nnoremap gb call NextBuffer endif Fast access to buffers nnoremap 1 1buffer nnoremap 2 2buffer nnoremap 3 3buffer nnoremap 4 4buffer nnoremap 5 5buffer nnoremap 6 6buffer nnoremap 7 7buffer nnoremap 8 8buffer nnoremap 9 9buffer nnoremap 0 10buffer Use real tabs instead of soft tabs if has eval Switch from soft tabs to real tabs function s UseTabs setlocal noexpandtab shiftwidth 8 softtabstop 8 endfunction nnoremap t call UseTabs endif Enable verbatim mode Used to view files with long lines or without syntax coloring list is not changed see next mapping nnoremap v setlocal nowrap nospell synmaxcol 0 2match Toggle list nnoremap l set invlist Make last active window the only window Similar to o nnoremap O p o Maps to change spell language between English and German and disable spell checking if exists spell nnoremap sn set nospell nnoremap se set spell spelllang en us nnoremap sd set spell spelllang de de If no spell support is available these mappings do nothing else nmap sn nmap se nmap sd endif if has eval and for selections in visual mode Thanks to http got ravings blogspot com 2008 07 vim pr0n visual search mappings html and all nerds involved godlygeek strull in vim on Freenode function s VSetSearch let l temp unnamed register normal gvy Added C to force noignorecase while searching the current visual selection I want to search for the exact string in this case let C V substitute escape n n g let l temp endfunction vnoremap call VSetSearch vnoremap call VSetSearch Use noignorecase for and See comment in s VSetSearch for details Thanks to the writers of s VSetSearch see above function s NSetSearch let l cword expand let l regex substitute escape l cword n n g let C V endfunction nnoremap call NSetSearch nnoremap call NSetSearch endif I often type W instead of w when trying to save a file Fix my mistake Thanks to Tony Mechelynck from the Vim mailing list for the commands if v version W getcmdtype getcmdpos Wa getcmdtype getcmdpos Wq getcmdtype getcmdpos Wqa getcmdtype getcmdpos Q getcmdtype getcmdpos Qa getcmdtype getcmdpos Thanks to frogonwheels and vimgor bot in vim on Freenode 2010 03 30 05 58 CEST nnoremap nohlsearch in insert mode deletes a lot break undo sequence before deleting the line so the change can be undone Thanks to the vimrc example vim file in Vim s source inoremap u Same for insert previously inserted text and leave insert mode inoremap u And for insert previously inserted text inoremap u And for delete word before cursor inoremap u if has eval New text objects ii and ai to work on text with the

    Original URL path: http://ruderich.org/simon/config/vimrc (2016-04-29)
    Open archived version from archive


  • run then run vcs info as the status might need to be updated case fc ln HISTCMD 1 in git g ret 0 hg ret 0 esac Must run vcs info when changing directories prompt chpwd zshrc force run vcs info 1 chpwd functions prompt chpwd Used by prompt code below to determine if vcs info should be run zshrc use vcs info 1 else zshrc use vcs info fi typeset a zshrc longrun data zshrc longrun data Display runtime in seconds for long running programs 60 seconds and send a bell to notify me zshrc longrun preexec local program 3 Handle fg local REPLY zshrc resolve fg to resumed job name program program REPLY No background process found if z program then return fi Don t track the time for certain possible long running processes which need no automatic notification for ignore in elinks man mutt vim do case program in ignore ignore zshrc longrun data return esac done zshrc longrun data program EPOCHSECONDS zshrc longrun precmd No previous timestamp available or disabled for this command ignore if z zshrc longrun data then return fi local difference EPOCHSECONDS zshrc longrun data 2 if difference gt 60 then echo echo n fg yellow echo n V zshrc longrun data 1 took difference seconds echo n fg default echo a send bell fi Clear status Prevents displaying old status information when pressing enter with an empty command line zshrc longrun data preexec functions zshrc longrun preexec precmd functions zshrc longrun precmd Set the prompt A two line prompt is used On the top left the current working directory is displayed on the right vcs info if available and the current time in hex On the bottom left current user name and host is shown the exit code of the last command if it wasn t 0 the number of running jobs if not 0 The prompt is in green and blue to make easily detectable the error exit code in red and bold and the job count in yellow Designed for dark terminals Thanks to Adam s prompt for the basic idea of this prompt zshrc prompt precmd Regex to remove elements which take no space Used to calculate the width of the top prompt Thanks to Bart s and Adam s prompt code in Functions Prompts prompt setup local zero BSUbfksu FB Call vcs info before every prompt if n zshrc use vcs info then vcs info else vcs info msg 0 vcs info msg 1 fi Setup Create variables holding the formatted content Current directory in yellow truncated if necessary WIDTH is replaced below local directory yellow WIDTH always display them immediately without requiring another a completes to aa and lists aaa aab aac as possible completions if the directory contains aaa aab aac bbb instead of only completing to aa setopt nolistambiguous Support completions in the middle of a word without this option zsh jumps to the end of the word before the completion process begins Is required for the prefix completer setopt completeinword Force a reload of the completion system if nothing matched this fixes installing a program and then trying to tab complete its name Thanks to Alex Munroe 1 for the code read on 2014 03 03 1 https github com eevee rc blob master zshrc force rehash if CURRENT 1 then rehash fi We didn t really complete anything return 1 zstyle completion completer force rehash expand complete prefix ignored approximate Match specification to be tried when completing items Each group is tried after another if no matches were found once matches are found no other groups are tried Thanks to Mikachu in zsh on Freenode 2012 08 28 18 48 CEST for explanations When matching also include the uppercase variant of typed characters m a z A Z using before this group would try the unmodified match first but I prefer to get all matches immediately e g if Makefile and makefile exist in the current directory echo m matches both with it would only match makefile because it found one match This allows typing in lowercase most of the time and completion fixes the case which is faster Don t perform these fixes in approximate to prevent it from changing the input too much Thanks to the book From Bash to Z Shell page 249 zstyle completion approximate matcher list m a z A Z Allow one mistake per three characters Thanks to the book From Bash to Z Shell page 248 zstyle e completion approximate max errors reply PREFIX SUFFIX 3 Expand shell wildcards to all matching files after echo results in a b c if the directory contains the files a b c Thanks to the book From Bash to Z Shell page 246 zstyle completion expand tag order all expansions Keep prefixes unexpanded if possible HOME doesn t expand HOME while HOME does zstyle completion expand keep prefix yes When completing multiple path components display all matching ambiguous components For example u s d r README lists all matching READMEs instead of just the matching paths up to the r component Can be slow if there are many matching files zstyle completion list suffixes yes Use ls like colors for completions zstyle completion list colors s LS COLORS Make completion lists scrollable so do you wish to see all n possibilities is no longer displayed Display current position in percent p zstyle completion default list prompt p Display group name d like external command alias etc in bold Also display a message if approximate found errors and no matches were found zstyle completion format B d b zstyle completion corrections format B d b errors e zstyle completion warnings format Bno matches for d b Display different types of matches separately zstyle completion group name Separate man pages by section zstyle completion separate sections yes Don t draw trailing in bold new in zsh 4 3 11 Thanks to Mikachu in zsh on Freenode for the fix 2010 12

    Original URL path: http://ruderich.org/simon/config/zshrc (2016-04-29)
    Open archived version from archive


  • GNU General Public License along with this file If not see Only one is necessary to get a list of all possible options set show all if ambiguous on set show all if unmodified on Always complete all items no matter how many there are set completion query items 1 And make sure we use a pager for completions this is also the default set page completions on Add character

    Original URL path: http://ruderich.org/simon/config/inputrc (2016-04-29)
    Open archived version from archive


  • clean ndx clf clean fdx Branches co checkout b branch a v br branch m merge mo merge origin master re rebase rei rebase interactive rec rebase continue Remote f fetch t tag p push Parallel git remote update Also strips unnecessary output ru git remote xargs d n n1 P0 git remote update 2 1 sed d Please make sure you have the correct access rights d and the repository exists d Push to all remotes Thanks to albel727 in git on Freenode 2011 06 04 16 06 CEST for the idea Modified to push in parallel and to strip unnecessary output rp git remote xargs d n n1 P0 git push 2 1 sed d Please make sure you have the correct access rights d and the repository exists d Patches fp format patch Maintenance Redirection of stderr is necessary to prevent missing output with my color stderr solution in Zsh fs git fsck strict full 2 1 fg git fs git gc aggressive 2 1 fsck and compress repo Misc sl stash list ss stash save ssk stash save keep index ssu stash save include untracked sa stash apply index sp stash pop index Custom commands tig like log view glog log pretty oneline graph all decorate abbrev commit Create backup of uncommitted and untracked changes ssb git stash save include untracked Backup on LANG C date a d b Y H M S z dev null git stash apply dev null Display list and content of untracked files Untracked directories and symbolic links are only listed u git ls files other exclude standard directory z xargs 0 sh c for x do printf 033 1 33m s 033 0m x if test d x then echo directory elif test h x then echo symbolic link else

    Original URL path: http://ruderich.org/simon/config/gitconfig (2016-04-29)
    Open archived version from archive


  • as the default but use relative dates set main view date relative author full commit title yes graph refs BINDINGS Allow moving in the main menu while displaying a diff in the bottom of the screen bind generic J next bind generic K previous Mutt like bindings to move to first and last line bind generic move first line bind generic move last line Close current view like in mutt bind diff i view close Unbind unnecessary views I only use the main view and view diffs of commits bind generic m none bind generic d none bind generic l none bind generic t none bind generic f none bind generic b none bind generic r none bind generic s none bind generic S none bind generic c none bind generic y none bind generic g none bind generic p none Unbind commands which may change the repository I use tig only as a viewer bind main C none COLORS Try to mimic gitk s colors color date default default color delimiter default default if text is too long Main window color cursor black cyan currently selected line color author default default color graph commit magenta default commit dots in

    Original URL path: http://ruderich.org/simon/config/tigrc (2016-04-29)
    Open archived version from archive


  • TERMINAL Enable 256 color mode term screen 256color Allow bold colors in XTerm not necessary for Rxvt not sure why this is necessary Otherwise normal and bold colors are switched Thanks to http www frexx de xterm 256 notes attrcolor b I CAPTION AND HARDSTATUS Use white on light blue background for highlighting and text messages and for window borders in split mode sorendition Bw Make sure the temporary variable we use is empty Thanks to http gist github com 133000 for the idea to use setenv and to TauPan in screen on Freenode 2010 03 10 16 11 CET for reminding me of it and searching it again unsetenv s Always display the caption setenv s s Bw white on light blue background also reset all attributes necessary so everything is displayed correctly setenv s s 3n window number setenv s s space setenv s s t window name caption always s unsetenv s Always display the status line with open windows and the hostname setenv s s Lw number and names of windows L displays window flags setenv s s right align the following text setenv s s l load average setenv s s space setenv s s H hostname hardstatus alwayslastline s unsetenv s BINDINGS Remove some bindings I don t use to prevent using them accidentally You probably don t want to copy this bind K kill bind k kill bind K kill bind quit bind quit bind Z suspend bind z suspend bind S xoff bind s xoff bind Q xon bind q xon bind G visual bell bind D power detach Bindings for fast switching to windows 10 to 19 Thanks to skizzhg in screen on Freenode 2010 10 31 21 49 CET for the suggestion bind command c window bind c window 0

    Original URL path: http://ruderich.org/simon/config/screenrc (2016-04-29)
    Open archived version from archive


  • window history in lines set option g history limit 50000 Display Tmux messages for a longer time in milliseconds set option g display time 3000 Open new windows with the current working directory used when Tmux was started and not the working directory of the current pane set option g default path TERMINAL Enable 256 color mode set option g default terminal screen 256color Disable alternative screen feature This way e g Vim s window content stays visible after quitting Vim This is quite useful to copy data needs tmux 1 5 to work almost completely set window option g alternate screen off Set title for outer terminal set option g set titles on Don t rename windows to the currently running program my zshrc does this for me with some additional features set window option g automatic rename off STATUS LINE White text set option g status fg white Bright blue background color colour12 set option g status bg colour12 Nothing left of window list set option g status left Current load average and hostname H on the right set option g status right uptime sed s load averages s g H Format for windows in the window list in the status line I window index W window number F window flags set window option g window status format I W F set window option g window status current format I W F Update status line commands only every minute set option g status interval 60 BINDINGS Use Vi m key bindings set option g status keys vi set window option g mode keys vi Use Ctrl A as escape binding like in GNU screen set option g prefix C a Ctrl A a sends Ctrl A to the process like in GNU screen bind key a send prefix

    Original URL path: http://ruderich.org/simon/config/tmux.conf (2016-04-29)
    Open archived version from archive



  •