dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 6fbb27d910f06ffdf71c08208616acf6a26f8e6b
parent 84d73c6b6098c53b60c6e36e94fd11fa837413b7
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 19 Jun 2019 15:01:05 +0200

Add file-specific commands

Diffstat:
M.config/vis/visrc.lua | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/.config/vis/visrc.lua b/.config/vis/visrc.lua @@ -84,7 +84,7 @@ vis.events.subscribe(vis.events.INIT, function() vis:map(vis.modes.NORMAL, leader..'p', ':< xclip -o<Enter>') vis:map(vis.modes.NORMAL, leader..'q', ':q<Enter>') vis:map(vis.modes.NORMAL, leader..'r', ':< scholarref ') - vis:map(vis.modes.NORMAL, leader..'t', ':!ctags -R . &<Enter>') + vis:map(vis.modes.NORMAL, leader..'t', ':!ctags -R . >/dev/null 2>&1 &<Enter>') vis:map(vis.modes.NORMAL, leader..'T', ':e ~/doc/todo.md<Enter>') vis:map(vis.modes.NORMAL, leader..'w', ':w<Enter>') vis:map(vis.modes.NORMAL, leader..'x', ':wq<Enter>') @@ -105,6 +105,14 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) vis:command('set tabwidth 4') vis:command('set colorcolumn 80') + -- file-type specific commands + if vis.win.syntax == 'latex' then + vis:command('set colorcolumn 80') + elseif vis.win.syntax == 'python' then + vis:command('set expandtab') + end + + -- file-type specific mappings vis:map(vis.modes.NORMAL, leader..'i', function() local command = interpreters[vis.win.syntax] @@ -135,4 +143,5 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) end return true; end) + end)