elvish_config/aliases/vi.elv

54 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2024-06-16 10:18:51 +00:00
var app = 'nvim'
var editors = [
&emac=[
&e={|@argv| e:emacs $@argv }
&v={|@argv| e:emacs $@argv --eval '(setq buffer-read-only)' }
]
&helix=[
&e={|@argv| e:helix $@argv }
&v={|@argv| e:helix $@argv } # Pas de lecture seule actuellement
]
&kak=[
&e={|@argv| e:kak $@argv }
&v={|@argv| e:kak -ro $@argv }
]
&nvim=[
&e={|@argv| e:nvim $@argv }
&v={|@argv| e:nvim -R $@argv }
]
&vim=[
&e={|@argv| e:vim $@argv }
&v={|@argv| e:vim -R $@argv }
]
]
var ce~ = $editors[$app]['e']
var cv~ = $editors[$app]['v']
# ÉDITEURS DISPOS
2022-09-02 13:53:03 +00:00
#fn ce {|@argv| e:emacs $@argv }
#fn ce {|@argv| e:helix $@argv }
#fn ce {|@argv| e:kak $@argv }
2022-09-02 13:53:03 +00:00
#fn ce {|@argv| e:nvim $@argv }
#fn ce {|@argv| e:vim $@argv }
# LECTURE SEULE
## emacs
#fn cv {|@argv| ce $@argv --eval '(setq buffer-read-only)' }
## helix (pas le lecture seule pour le moment)
#fn cv {|@argv| ce $@argv }
## kak
#fn cv {|@argv| ce -ro $@argv }
# nvim/vim
#fn cv {|@argv| ce -R $@argv }
edit:add-var vi~ $ce~
edit:add-var vb~ {|@argv| ce $@argv ~/.bashrc }
edit:add-var vc~ {|@argv| ce $@argv ~/.vimrc }
edit:add-var ve~ {|@argv| ce $@argv ~/.config/elvish/rc.elv }
edit:add-var vf~ {|@argv| ce $@argv ~/.config/fish/config.fish }
edit:add-var vp~ {|@argv| ce $@argv PKGBUILD }
edit:add-var vv~ $cv~
edit:add-var vz~ {|@argv| ce $@argv ~/.zshrc }