質問

I can quickly load in and reload my .vimrc file via the following mappings

nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>

How can I accomplish this with my .tmux.conf file? Guess I am looking for the path to my .tmux.conf. Maybe something like $MYTMUXCONF.

P.S. My .tmux.conf and .vimrc files actually live in a dir named dotfiles/ and have been renamed tmux.conf and vimrc respectively so I can back them up on Github.

役に立ちましたか?

解決

I assume you have a symlink in your home directory pointing to the tmux.conf in dotfiles/. Vim will follow the symlink and edit the actual file. If this isn't the case just add the path to your tmux.conf in the shortcut.

nnoremap <silent> <leader>et :e ~/.tmux.conf<CR>

$MYVIMRC is a special variable in vim pointing to the vimrc it loaded. It isn't a normal environment variable (unless you set it yourself). If you wanted to add an environment variable in your config files somewhere you could do that. Vim will read the environment variables if you do that and you can create a mapping to refer to that variable.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top