diff options
| author | nsfisis <nsfisis@gmail.com> | 2022-12-18 18:50:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2022-12-18 18:50:05 +0900 |
| commit | 70e6ee4a8f5a1da1a00d26f9caf98da8071cd456 (patch) | |
| tree | 2dcb08cac5eeca1e9c4080de4d068e4d06d99f02 | |
| parent | f409c93c1d5c45b5b00eb1df979febd2e9c7a032 (diff) | |
| download | dotfiles-70e6ee4a8f5a1da1a00d26f9caf98da8071cd456.tar.gz dotfiles-70e6ee4a8f5a1da1a00d26f9caf98da8071cd456.tar.zst dotfiles-70e6ee4a8f5a1da1a00d26f9caf98da8071cd456.zip | |
misc: install vim-startuptime
| -rw-r--r-- | INSTALL.txt | 6 | ||||
| -rwxr-xr-x | scripts/nvim-startup.sh | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/INSTALL.txt b/INSTALL.txt index e00793c..142213b 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -40,7 +40,7 @@ $ sudo atsutil databases -remove $ /usr/local/opt/ncurses/bin/infocmp tmux-256color > /var/tmp/tmux-256color.info $ tic -xe tmux-256color /var/tmp/tmux-256color.info -$ nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' +$ go install github.com/rhysd/vim-startuptime@latest # Restart your machine. ``` @@ -83,7 +83,7 @@ $ sudo adduser $(whoami) docker $ cargo install hgrep $ cargo install alacritty -$ snap install zig --classic --edge +$ go install github.com/rhysd/vim-startuptime@latest -$ nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' +$ snap install zig --classic --edge ``` diff --git a/scripts/nvim-startup.sh b/scripts/nvim-startup.sh index 1efc93e..bc275ab 100755 --- a/scripts/nvim-startup.sh +++ b/scripts/nvim-startup.sh @@ -1,11 +1,9 @@ #!/bin/bash -if [[ "$1" == '-s' ]]; then - _filter='sort -nr -k2' +if type vim-startuptime >/dev/null 2>&1; then + vim-startuptime -vimpath nvim > ./nvim-startup.log else - _filter='cat' + log="$(mktemp)" + nvim --startuptime "$log" +q + sort -nr -k2 "$log" > ./nvim-startup.log fi - -log="$(mktemp)" -nvim --startuptime "$log" +q -$_filter "$log" > ./nvim-startup.log |
