필요 없다셸에서 nvim 치기

2816 단어 Neovimtmuxtech

모티프


잘 모르는 버튼이 많은 IDE 같은 UI가 두려워 베스코드의 젠모드 같은 화면에서 프로그래밍을 한다.
before
그림 아래에 nvim의statusline을 사용하지 않고 파일에 대한 약간의 정보만 표시합니다.맨 윗부분의 tmux window 제목도 'nvim', 'zsh', 프로그램 이름만 있습니다.
불필요한 공간을 절약하기 위해 파일 정보를 tmux window 제목에 표시하고 nvim statusline을 숨깁니다.
after laststatus=0 설정에statusline을 숨겼을 때 줄 번호와 열 번호를 표시하는 곳ruler이 있는 것 같습니다.이쪽도 변경할 수 있어요.

메서드


비록vim의statusline은 형식을statusline으로 설정해서 표시하지만 nvim는 형식을 전달하여 나타나는 문자열을 되돌려주는 함수 nvim입니다eval_나는 statusline이 있다.서버-client에서 이루어지기 때문에 임의의vim script를 간단하게 연결해서 실행할 수 있습니다.
이상은 플러그인 형식입니다.
https://github.com/octaltree/nvim-status-bash
그림% 1개의 캡션을 편집했습니다.
set -g automatic-rename on
set -g @nvim_status "%Y %f%{substitute(' ' .. (has('multi_byte')&&\&fileencoding!=''?&fileencoding:&encoding), ' utf-8', '', '')}%{substitute(' ' .. &fileformat, ' unix', '', '')}%{&bomb? ' bomb': ''}"
set -g window-status-current-format '#I:#{?#{m:#{pane_current_command},zsh},#(basename #{pane_current_path})/,#{?#{m:#{pane_current_command},nvim},#(`tmux show -vg @nvim_status_bin`/tmux_nvim_status #{pane_id} '@nvim_status'),#{pane_current_command}}}'
set -g window-status-format '#I:#{?#{m:#{pane_current_command},zsh},#(basename #{pane_current_path})/,#{?#{m:#{pane_current_command},nvim},#(`tmux show -vg @nvim_status_bin`/tmux_nvim_status #{pane_id} '@nvim_status'),#{pane_current_command}}}'
약간 과장되었지만 현재의 윈도와 다른 윈도에서 중복 설정된 Tmux 형식에서if식의 기호량이 비교적 많기 때문에 내용은 매우 간단하다.
만약 식의 설명을 부탁드립니다.나도 많이 참고했어.
tmux의 window 이름이 zsh일 때만 현재 디렉터리 - Qiita
플러그인에서 제공하는 조개 스크립트 tmux_nvim_status 를 두드리고 있습니다.tmux_nvim_status 윈도우의 이벤트pane의foreground 과정이 nvim일 때 pid를 가져오고 조개 스크립트nvim_eval_statusline로 statusline을 가져옵니다.nvim_eval_statusline 겸사겸사 임의의vim scriptnvim_exec를 실행할 준비를 했지만 이동성을 요구하지 않으면 neovim-remote라는 선택도 있었다.괜찮으시면
너무 소홀합니다.

좋은 웹페이지 즐겨찾기