From baa8727f1fc58acc945b28d3a83521dc881ab464 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 11 Jun 2020 14:57:01 +0800 Subject: [PATCH] [feature] nvim+tmux will crash over ssh on ubuntu --- bin/02-install-base-pkgs.fish | 2 +- bin/06-config-user.fish | 6 +++++- config/nvim/init.vim | 9 ++++++++- ubuntu/install-vim.sh | 8 +++----- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/bin/02-install-base-pkgs.fish b/bin/02-install-base-pkgs.fish index 84a65b6..55e2c43 100755 --- a/bin/02-install-base-pkgs.fish +++ b/bin/02-install-base-pkgs.fish @@ -5,7 +5,7 @@ set DIR (dirname (dirname (readlink -f (status --current-filename)))) # cli basic tooling pacman -S \ base-devel \ - neovim \ + vim neovim \ tmux bc \ unzip p7zip \ openssh \ diff --git a/bin/06-config-user.fish b/bin/06-config-user.fish index a2a47e8..983bb1a 100755 --- a/bin/06-config-user.fish +++ b/bin/06-config-user.fish @@ -47,7 +47,11 @@ argparse 'c/cli-only' -- $argv link-dotfolder config link-dotfolder pip link-dotfile tmux.conf -link-dotfile vimrc +#link-dotfile vimrc +rm -rf ~/.vimrc ~/.vim/coc-settings.json +ln -s $DIR/config/nvim/init.vim ~/.vimrc +mkdir -p ~/.vim +ln -s $DIR/config/nvim/coc-settings.json ~/.vim/coc-settings.json # install tpm git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 0d87c92..ab8074a 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -13,6 +13,7 @@ set nobackup set hlsearch set noswapfile set ignorecase +set laststatus=2 set fillchars=vert:\ ,fold:- filetype plugin indent on syntax on @@ -40,6 +41,8 @@ noremap vnoremap p "_dP nnoremap q :qall +nnoremap 1 :b1 + " trailing spaces highlight ExtraWhitespace ctermbg=red guibg=red @@ -48,7 +51,11 @@ au Syntax * match ExtraWhitespace /\s\+$/ nnoremap es :%s/\s\+$//g " auto install vim-plug -let vim_plug_path = expand("~/.config/nvim/autoload/plug.vim") +if has('nvim') + let vim_plug_path = expand("~/.config/nvim/autoload/plug.vim") +else + let vim_plug_path = expand("~/.vim/autoload/plug.vim") +endif let vim_plug_just_installed = 0 if !filereadable(vim_plug_path) echo "Installing vim-plug..." diff --git a/ubuntu/install-vim.sh b/ubuntu/install-vim.sh index 3cf41f7..e891025 100755 --- a/ubuntu/install-vim.sh +++ b/ubuntu/install-vim.sh @@ -2,10 +2,8 @@ set -e -#sudo add-apt-repository ppa:jonathonf/vim -y -#sudo apt update -#sudo apt install -y vim - +sudo add-apt-repository ppa:jonathonf/vim -y sudo add-apt-repository ppa:neovim-ppa/stable -y -sudo apt-get update +#sudo apt update +sudo apt install -y vim sudo apt install -y neovim