diff --git a/README.md b/README.md
index 6249028..bf75522 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# cli develop env
### os
-* ubuntu
+* ubuntu20.04
### language
- php
- c/c++
diff --git a/helper/option.sh b/helper/option.sh
index 9967029..f4afc65 100644
--- a/helper/option.sh
+++ b/helper/option.sh
@@ -8,6 +8,7 @@ OPT_LEETCODE=
OPT_MAN=
OPT_DICT=
OPT_BASH=
+OPT_VIM=
OPT_FE=
OPT_NO_DEFX_ICON=
@@ -26,5 +27,6 @@ do
--with_bash) OPT_BASH=yes ;;
--with_fe) OPT_FE=yes ;;
--without_defx_icon) OPT_NO_DEFX_ICON=yes ;;
+ --with_vim) OPT_VIM=yes ;;
esac
done
diff --git a/init.sh b/init.sh
index 454c167..114fd3b 100755
--- a/init.sh
+++ b/init.sh
@@ -9,17 +9,11 @@ source "./helper/system_info.sh"
source "./helper/installer.sh"
source "./helper/option.sh"
ins dep
-ins pxy
-ins zsh
-ins hyper
+
ins neovim
ins tmux
-ins karabiner
-ins ssh
-ins clipper
-ins phoenix
-if [ "Y$OPT_JAVA" == "Yyes" ];then
- ins jdk
-fi
-zsh
+ins zsh
+
+
+
# vim: set ts=4 sw=4 tw=0 et :
diff --git a/tools/clipper/com.wincent.clipper.plist b/tools/clipper/com.wincent.clipper.plist
deleted file mode 100644
index 21b50f6..0000000
--- a/tools/clipper/com.wincent.clipper.plist
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
- Label
- com.wincent.clipper
- ProgramArguments
-
- /usr/local/bin/clipper
-
- EnvironmentVariables
-
- LANG
- en_US.UTF-8
-
- KeepAlive
-
- LimitLoadToSessionType
- Aqua
-
-
diff --git a/tools/clipper/mac_init.sh b/tools/clipper/mac_init.sh
deleted file mode 100644
index 532c4e2..0000000
--- a/tools/clipper/mac_init.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-if [ ! -f ~/Library/LaunchAgents/com.wincent.clipper.plist ];then
- cp tools/clipper/com.wincent.clipper.plist ~/Library/LaunchAgents/
- launchctl load -w -S Aqua ~/Library/LaunchAgents/com.wincent.clipper.plist
-fi
-
diff --git a/tools/dep/centos_init.sh b/tools/dep/centos_init.sh
deleted file mode 100644
index 82b3277..0000000
--- a/tools/dep/centos_init.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-! which rg && \
-sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo && \
-sudo yum install -y ripgrep
-
-! which fzf && \
-wget https://github.com/junegunn/fzf-bin/releases/download/0.17.5/fzf-0.17.5-linux_amd64.tgz &&
-tar xzvf fzf-0.17.5-linux_amd64.tgz && sudo mv fzf "/usr/local/bin" && rm fzf-*.tgz
-
-sudo yum install -y python34-pip
-sudo yum install -y python2-pip zsh
-
-
-! which netcat && \
-wget http://sourceforge.net/projects/netcat/files/netcat/0.7.1/netcat-0.7.1.tar.gz && \
-tar xzvf netcat-0.7.1.tar.gz && \
-cd netcat-0.7.1 && \
-./configure && make && make install && \
-cd ..
diff --git a/tools/dep/mac_init.sh b/tools/dep/mac_init.sh
deleted file mode 100644
index b6521bf..0000000
--- a/tools/dep/mac_init.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-which brew
-if ! which brew;then
- /usr/bin/ruby -e \
- "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-fi
-
-apps="wget fzf ripgrep autojump netcat iproute2mac clipper nmap graphviz"
-for app in $apps
-do
- ! brew list | grep $app && brew install $app
-done
-
-! brew list | grep python && brew install python3
-! brew list | grep python@2 && brew install python2
-! brew list | grep node && brew install node
-! brew list | grep yarn && brew install yarn
-! ls /Library/Fonts | grep Fura &&
-wget https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/FiraCode/Retina/complete/Fura%20Code%20Retina%20Nerd%20Font%20Complete%20Mono.ttf && \
-mv Fura*Mono.ttf /Library/Fonts
-! brew list | grep gnu-sed && brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep
diff --git a/tools/dep/ubuntu_init.sh b/tools/dep/ubuntu_init.sh
index aa7cdbd..893eddc 100644
--- a/tools/dep/ubuntu_init.sh
+++ b/tools/dep/ubuntu_init.sh
@@ -1,97 +1,67 @@
#!/bin/bash
-apt-get install -y gawk curl zsh language-pack-zh-hans language-pack-zh-hans-base \
- git unzip wget python-dev python3-pip python-pip lsof \
- libtool-bin gettext sudo \
- cmake automake m4 autoconf libtool build-essential pkg-config wamerican \
- autojump nmap iproute2 net-tools sshfs axel
+apt-get install -y gawk curl zsh \
+ git unzip wget python3-pip lsof sudo \
+ autojump nmap iproute2 net-tools axel netcat ripgrep
+
+ #clibtool-bin gettext make automake m4 autoconf libtool build-essential pkg-config wamerican \
+
+
apt-get remove -y neovim exuberant-ctags
-npm install -g yarn
+
+
+
if [ "Y$OPT_MAN" == "Yyes" ];then
[ -f /etc/dpkg/dpkg.cfg.d/excludes ] && rm -rf /etc/dpkg/dpkg.cfg.d/excludes
apt-get install -y \
cppman man manpages manpages-dev manpages-posix manpages-posix-dev
fi
-if [ "Y$OPT_DICT" == "Yyes" ];then
- apt-get install -y sdcv
- if [ ! -d /usr/share/stardict/dict/stardict-oxford-gb-2.4.2 ];then
- mkdir -p /usr/share/stardict/dic/ && \
- wget http://download.huzheng.org/zh_CN/stardict-oxford-gb-2.4.2.tar.bz2 && \
- wget http://download.huzheng.org/zh_CN/stardict-wubi86-2.4.2.tar.bz2 && \
- tar -xjvf stardict-wubi86-2.4.2.tar.bz2 -C /usr/share/stardict/dic && \
- tar -xjvf stardict-oxford-gb-2.4.2.tar.bz2 -C /usr/share/stardict/dic && \
- rm -rf stardict-*
- fi
-fi
-
-#install clangd8 url:https://apt.llvm.org/
-if [ "Y$OPT_CPP" == "Yyes" ];then
- ! ( grep -F "llvm-toolchain-" /etc/apt/sources.list ) && \
- cat >> /etc/apt/sources.list < /dev/null; then
- sudo npm i -g bash-language-server --unsafe-perm
+ npm i -g bash-language-server --unsafe-perm
fi
fi
+
if [ "Y$OPT_PHP" == "Yyes" ];then
- sudo npm i -g intelephense
+ apt install php -y
+ npm i -g intelephense
fi
+
if [ "Y$OPT_PYTHON" == "Yyes" ];then
- sudo pip3 install jedi
+ pip3 install jedi
+fi
+
+if [ "Y$OPT_VIM" == "Yyes" ];then
+
+ apt install -y npm
+ npm install -g yarn
+ yarn global add vim-language-server
+fi
+
+if [ "Y$OPT_GO" == "Yyes" ];then
+
+ if [ ! -f /usr/local/bin/gopkgs ];then
+ wget https://github.com/haya14busa/gopkgs/releases/download/v1.0.0/gopkgs_linux_amd64 && mv gopkgs_linux_amd64 /usr/local/bin/gopkgs && chmod u+x /usr/local/bin/gopkgs
+ fi
+
fi
if [ "Y$OPT_LUA" == "Yyes" ];then
apt install -y lua5.3-dev luarocks lua5.3
luarocks install --server=http://luarocks.org/dev lua-lsp
fi
+
if [ "Y$OPT_FE" == "Yyes" ];then
sudo npm install -g typescript typescript-language-server
sudo npm install -g vscode-css-languageserver-bin
fi
-if [ "Y$OPT_JAVA" == "Yyes" ];then
- OLD_DIR=`pwd`
- if [ ! -d ~/.config/coc/extensions/coc-java-data/server/config_linux ];then
- mkdir -p ~/.config/coc/extensions/coc-java-data/server && \
- cd ~/.config/coc/extensions/coc-java-data/server && \
- axel https://download.eclipse.org/jdtls/milestones/0.35.0/jdt-language-server-0.35.0-201903142358.tar.gz && \
- tar xf jdt-language-server-0.35.0-201903142358.tar.gz && rm jdt-language-server*.tar.gz
- fi
- cd $OLD_DIR
- if [ ! -d /opt/apache-maven-3.6.1 ];then
- # install maven
- cd /opt && \
- wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz && \
- tar xf apache-maven-3.6.1-bin.tar.gz && \
- export PATH=/opt/apache-maven-3.6.1/bin:$PATH && \
- echo "export PATH=\"/opt/apache-maven-3.6.1:$PATH\"" >> "$HOME/.cus_zshrc"
- cd $OLD_DIR
- fi
-fi
-# install ripgrep
-! which rg && \
- curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep_0.10.0_amd64.deb && \
- sudo dpkg -i ripgrep_0.10.0_amd64.deb && rm -rf ripgrep_0.10.0_amd64.deb
diff --git a/tools/hyper/hyper.js b/tools/hyper/hyper.js
deleted file mode 100644
index 78a014a..0000000
--- a/tools/hyper/hyper.js
+++ /dev/null
@@ -1,164 +0,0 @@
-// Future versions of Hyper may add additional config options,
-// which will not automatically be merged into this file.
-// See https://hyper.is#cfg for all currently supported options.
-
-module.exports = {
- config: {
- // choose either `'stable'` for receiving highly polished,
- // or `'canary'` for less polished but more frequent updates
- updateChannel: 'stable',
-
- // default font size in pixels for all tabs
- fontSize: 16,
-
- // font family with optional fallbacks
- fontFamily: '"FuraCode Nerd Font Mono", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
- // default font weight: 'normal' or 'bold'
- fontWeight: 'normal',
-
- // font weight for bold characters: 'normal' or 'bold'
- fontWeightBold: 'bold',
-
- // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
- cursorColor: 'rgba(248,28,229,0.8)',
-
- // terminal text color under BLOCK cursor
- cursorAccentColor: '#000',
-
- // `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █
- cursorShape: 'BLOCK',
-
- // set to `true` (without backticks and without quotes) for blinking cursor
- cursorBlink: false,
-
- // color of the text
- foregroundColor: '#fff',
-
- // terminal background color
- // opacity is only supported on macOS
- backgroundColor: '#000',
-
- // terminal selection color
- selectionColor: 'rgba(248,28,229,0.3)',
-
- // border color (window, tabs)
- borderColor: '#333',
-
- // custom CSS to embed in the main window
- css: '',
-
- // custom CSS to embed in the terminal window
- termCSS: '',
-
- // if you're using a Linux setup which show native menus, set to false
- // default: `true` on Linux, `true` on Windows, ignored on macOS
- showHamburgerMenu: '',
-
- // set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons
- // additionally, set to `'left'` if you want them on the left, like in Ubuntu
- // default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS
- showWindowControls: '',
-
- // custom padding (CSS format, i.e.: `top right bottom left`)
- padding: '3px 0px 14px 0px',
-
- // the full list. if you're going to provide the full color palette,
- // including the 6 x 6 color cubes and the grayscale map, just provide
- // an array here instead of a color map object
- colors: {
- black: '#000000',
- red: '#C51E14',
- green: '#1DC121',
- yellow: '#C7C329',
- blue: '#0A2FC4',
- magenta: '#C839C5',
- cyan: '#20C5C6',
- white: '#C7C7C7',
- lightBlack: '#686868',
- lightRed: '#FD6F6B',
- lightGreen: '#67F86F',
- lightYellow: '#FFFA72',
- lightBlue: '#6A76FB',
- lightMagenta: '#FD7CFC',
- lightCyan: '#68FDFE',
- lightWhite: '#FFFFFF',
- },
-
- // the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
- // if left empty, your system's login shell will be used by default
- //
- // Windows
- // - Make sure to use a full path if the binary name doesn't work
- // - Remove `--login` in shellArgs
- //
- // Bash on Windows
- // - Example: `C:\\Windows\\System32\\bash.exe`
- //
- // PowerShell on Windows
- // - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
- shell: '',
-
- // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
- // by default `['--login']` will be used
- shellArgs: ['--login'],
-
- // for environment variables
- env: {},
-
- // set to `false` for no bell
- bell: 'SOUND',
-
- // if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard
- copyOnSelect: false,
-
- // if `true` (without backticks and without quotes), hyper will be set as the default protocol client for SSH
- defaultSSHApp: true,
-
- // if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no
- // selection is present (`true` by default on Windows and disables the context menu feature)
- // quickEdit: true,
-
- // URL to custom bell
- // bellSoundURL: 'http://example.com/bell.mp3',
-
- // for advanced config flags please refer to https://hyper.is/#cfg
-
- hyperTabs: {
- trafficButtons: true,
- border: true,
- tabIconsColored: true,
- activityColor: 'salmon',
- },
- visor: {
- hotkey: 'Command+P',
- position: 'top', // or left, right, bottom
- },
- },
-
-
- // a list of plugins to fetch and install from npm
- // format: [@org/]project[#version]
- // examples:
- // `hyperpower`
- // `@company/project`
- // `project#1.0.1`
- plugins: [
- 'hyper-one-dark',
- 'hyper-tabs-enhanced',
- "hyper-dark-scrollbar",
- "hyper-search",
- "hyperterm-visor",
- ],
-
-
-
- // in development, you can create a directory under
- // `~/.hyper_plugins/local/` and include it here
- // to load it and avoid it being `npm install`ed
- localPlugins: [],
-
- keymaps: {
- // Example
- // 'window:devtools': 'cmd+alt+o',
- },
-};
diff --git a/tools/hyper/mac_init.sh b/tools/hyper/mac_init.sh
deleted file mode 100755
index b775bae..0000000
--- a/tools/hyper/mac_init.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-rm ~/.hyper.js
-cp tools/hyper/hyper.js ~/.hyper.js
-if [ -d "/Applications/Hyper.app" ];then
- return
-fi
-
-wget "https://github.com/zeit/hyper/releases/download/2.1.0/Hyper-2.1.0.dmg"
-sudo hdiutil attach -quiet "Hyper-2.1.0.dmg"
-sudo cp -r "/Volumes/Hyper 2.1.0/Hyper.app" /Applications
-sudo hdiutil detach "/Volumes/Hyper 2.1.0"
-rm -rf "Hyper-2.1.0.dmg"
diff --git a/tools/jdk/init.sh b/tools/jdk/init.sh
deleted file mode 100644
index 4ae594c..0000000
--- a/tools/jdk/init.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-
-JDK_VERSION=11
-function jdk(){
- DOWN_URL="https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz"
- sudo mkdir -p /usr/lib/jvm && sudo chmod 777 /usr/lib/jvm
- if [ ! -d /usr/lib/jvm/jdk${JDK_VERSION} ]; then
- if [ ! -f openjdk*.tar.gz ];
- then
- echo "downloading jdk ${JDK_VERSION}"
- wget $DOWN_URL
- fi
- rm -rf /usr/lib/jvm/*
- tar xzvf openjdk*.tar.gz && mv jdk-11 jdk${JDK_VERSION} && mv jdk${JDK_VERSION} /usr/lib/jvm/
- echo "export JAVA_HOME=/usr/lib/jvm/jdk${JDK_VERSION}" >> "$HOME/.cus_zshrc"
- echo "export CLASSPATH=\".:/usr/lib/jvm/jdk${JDK_VERSION}/lib:/usr/lib/jvm/jdk${JDK_VERSION}\"" >> "$HOME/.cus_zshrc"
- echo "export PATH=\"/usr/lib/jvm/jdk${JDK_VERSION}/bin:$PATH\"" >> "$HOME/.cus_zshrc"
- export JAVA_HOME="/usr/lib/jdk${JDK_VERSION}"
- export CLASSPATH=".:/usr/lib/jvm/jdk${JDK_VERSION}/lib:/usr/lib/jvm/jdk${JDK_VERSION}"
- export PATH="/usr/lib/jvm/jdk${JDK_VERSION}/bin:$PATH"
- fi
-}
-if [ ! -f /usr/lib/jvm/jdk${JDK_VERSION}/bin/java ];then
- jdk
-fi
diff --git a/tools/jdk/mac_init.sh b/tools/jdk/mac_init.sh
deleted file mode 100644
index a504c66..0000000
--- a/tools/jdk/mac_init.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-#http://www.linuxidc.com/Linux/2016-06/132678.htm
-
-function downloadjdk(){
- wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/11.0.2+9/f51449fcd52f4d52b93a989c5c56ed3c/jdk-11.0.2_osx-x64_bin.dmg
-}
-
-
-function jdk(){
- if [ ! -f jdk-11.0.2_osx-x64_bin.dmg ];then
- downloadjdk
- fi
- sudo hdiutil attach -quiet jdk-11.0.2_osx-x64_bin.dmg
- sudo installer -pkg /Volumes/JDK\ 11.0.2/JDK\ 11.0.2.pkg -target "/"
- sudo hdiutil detach "/Volumes/JDK 11.0.2"
-
-}
-if [ ! -d /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk ];then
- jdk
-fi
diff --git a/tools/karabiner/mac_init.sh b/tools/karabiner/mac_init.sh
deleted file mode 100644
index 1bd4c69..0000000
--- a/tools/karabiner/mac_init.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-if [ ! -d /Applications/Karabiner-Elements.app ];then
- wget "https://pqrs.org/osx/karabiner/files/Karabiner-Elements-12.1.0.dmg"
- sudo hdiutil attach -quiet "Karabiner-Elements-12.1.0.dmg"
- sudo installer -pkg "/Volumes/Karabiner-Elements-12.1.0/Karabiner-Elements.sparkle_guided.pkg" -target /
- sudo hdiutil detach "/Volumes/Karabiner-Elements-12.1.0"
- rm -rf "Karabiner-Elements-12.1.0.dmg"
-fi
-rm -rf ~/.config/karabiner/assets/complex_modifications/cap_esc_exchage_terminal.json && \
-wget -P ~/.config/karabiner/assets/complex_modifications/ https://raw.githubusercontent.com/zhoupro/cap_esc_exchange_terminal/master/cap_esc_exchage_terminal.json
diff --git a/tools/neovim/add_swap.sh b/tools/neovim/add_swap.sh
deleted file mode 100644
index 64192ca..0000000
--- a/tools/neovim/add_swap.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# size of swapfile in megabytes
-swapsize=2048
-
-# does the swap file already exist?
-grep -q "swapfile" /etc/fstab
-
-# if not then create it
-if [ $? -ne 0 ]; then
- echo 'swapfile not found. Adding swapfile.'
- fallocate -l ${swapsize}M /swapfile
- chmod 600 /swapfile
- mkswap /swapfile
- swapon /swapfile
- echo '/swapfile none swap defaults 0 0' >> /etc/fstab
-else
- echo 'swapfile found. No changes made.'
-fi
-
-# output results to terminal
-cat /proc/swaps
-cat /proc/meminfo | grep Swap
diff --git a/tools/neovim/base_init.vim b/tools/neovim/base_init.vim
deleted file mode 100755
index 85d82de..0000000
--- a/tools/neovim/base_init.vim
+++ /dev/null
@@ -1,384 +0,0 @@
-call plug#begin('~/.local/share/nvim/plugged')
- "deop
- Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
- "outline
- Plug 'majutsushi/tagbar'
- Plug 'vim-airline/vim-airline'
- Plug 'vim-airline/vim-airline-themes'
- " explore
- Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
- Plug 'junegunn/fzf.vim'
- Plug 'vim-scripts/ctags.vim'
- Plug 'tpope/vim-commentary'
- " explore
- if has('nvim')
- Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
- else
- Plug 'Shougo/defx.nvim'
- Plug 'roxma/nvim-yarp'
- Plug 'roxma/vim-hug-neovim-rpc'
- endif
- Plug 'kristijanhusak/defx-icons'
- Plug 'kristijanhusak/defx-git'
- "git
- Plug 'tpope/vim-fugitive'
- Plug 'airblade/vim-gitgutter'
- Plug 'gregsexton/gitv'
- " c
- Plug 'vim-scripts/a.vim'
- " transform
- Plug 'tpope/vim-abolish'
- Plug 'tpope/vim-surround'
- Plug 'tpope/vim-repeat'
- " snips
- Plug 'SirVer/ultisnips'
- Plug 'honza/vim-snippets'
- " themes
- Plug 'joshdick/onedark.vim'
- " 语言语法高亮
- Plug 'sheerun/vim-polyglot'
- " num rep
- Plug 'glts/vim-magnum'
- Plug 'glts/vim-radical'
- " mru
- Plug 'vim-scripts/mru.vim'
- " start screen
- Plug 'mhinz/vim-startify'
- " add header
- Plug 'alpertuna/vim-header'
- " select
- Plug 'terryma/vim-expand-region'
- Plug 'terryma/vim-multiple-cursors'
- "nginx
- Plug 'chr4/nginx.vim'
- " icon
- Plug 'ryanoasis/vim-devicons'
- " tmux
- Plug 'christoomey/vim-tmux-navigator'
- Plug 'junegunn/goyo.vim'
- "indent
- Plug 'Yggdroot/indentLine'
- "undo
- Plug 'mbbill/undotree'
- "markdown
- " have nodejs and yarn
- Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
- Plug 'wellle/targets.vim'
- Plug 'forevernull/vim-json-format'
- Plug 'paroxayte/vwm.vim'
- Plug 'jiangmiao/auto-pairs'
- Plug 'iandingx/leetcode.vim'
- " graphviz
- Plug 'liuchengxu/graphviz.vim'
- call plug#end()
-
-" our will be the space key
-let mapleader=","
-set noswapfile
-map js :call json_format#parse("l")
-" Highlight search results
-set hlsearch
-" Makes search act like search in modern browsers
-set incsearch
-" clear highlight
-nnoremap :nohlsearch
-map K (expand_region_expand)
-map J (expand_region_shrink)
-"""""""""""""""""""""""""""""""""""""
-" Mappings configurationn
-"""""""""""""""""""""""""""""""""""""
-map n :Defx
-map m :TagbarOpenAutoClose
-
-func! RunProgram()
- exec "w"
- if &filetype == 'c'
- exec "!gcc % -o %<"
- exec "! ./%<"
- elseif &filetype == 'cpp'
- exec "!g++ % -o %<"
- exec "! ./%<"
- elseif &filetype == 'sh'
- exec "!bash %"
- elseif &filetype == 'go'
- exec "!go run %"
- elseif &filetype == 'python'
- exec "!python %"
- elseif &filetype == 'php'
- exec "!php %"
- elseif &filetype == 'lua'
- exec "!lua %"
- elseif &filetype == 'dot'
- exec "GraphvizCompile png"
- exec "Graphviz png"
- elseif &filetype == 'java'
- exec "!javac %"
- exec "!java -cp %:p:h %:t:r"
- endif
-endfunc
-autocmd VimEnter * noremap t :call RunProgram()
-" ctags
-set tags=tags; " ; 不可省略,表示若当前目录中不存在tags, 则在父目录中寻找。
-nmap ]s :call GenCscope()
-func! GenCscope()
- exec "w"
- if &filetype == 'php'
- exec '!find . -name "*.php" > cscope.files'
- exec "!cscope -bkq -i cscope.files"
- exec "!(cat cscope.files | ctags -f tags --languages=php --php-kinds=ctif --fields=+aimS -L -)"
- elseif &filetype == 'c'
- exec '!find . -name "*.c" -o -name "*.h" > cscope.files'
- exec "!cscope -bkq -i cscope.files"
- exec "!(cat cscope.files | ctags -f tags --c++-kinds=+p --fields=+iaS --extras=+q -L -)"
- endif
-endfunc
-
-if has("cscope")
- set cscopetag " 使支持用 Ctrl+] 和 Ctrl+t 快捷键在代码间跳来跳去
- " check cscope for definition of a symbol before checking ctags:
- " set to 1 if you want the reverse search order.
- set csto=1
- nmap [s :cs find s =expand("")
- nmap [g :cs find g =expand("")
- nmap [c :cs find c =expand("")
- nmap [t :cs find t =expand("")
- nmap [e :cs find e =expand("")
- nmap [f :cs find f =expand("")
- nmap [i :cs find i =expand("")$
- nmap [d :cs find d =expand("")
-endif
-" Autoloading Cscope Database
-function! LoadCscope()
- let db = findfile("cscope.out", ".;")
- if (!empty(db))
- let path = strpart(db, 0, match(db, "/cscope.out$"))
- set nocscopeverbose " suppress 'duplicate connection' error
- exe "cs add " . db . " " . path
- set cscopeverbose
- " else add the database pointed to by environment variable
- elseif $CSCOPE_DB != ""
- cs add $CSCOPE_DB
- endif
-endfunction
-au BufEnter /* call LoadCscope()
-
-set background=dark
-
-
-" for debug
-set nu
-set list
-
-" exploer
-nnoremap f :Files
-nnoremap e :MRU
-
-" snips
-" UltiSnips 的 tab 键与 YCM 冲突,重新设定
-let g:UltiSnipsExpandTrigger=""
-let g:UltiSnipsJumpForwardTrigger=""
-let g:UltiSnipsJumpBackwardTrigger=""
-nnoremap y :call system('NCCOMMAND NCHOST 8377', @0)
-nnoremap ] :call fzf#vim#tags('^' . expand(''), {'options': '--exact --select-1 --exit-0 +i'})
-
-" color change fix in tmux
-set t_Co=256
-"switch windows
-if has('nvim')
- " Terminal mode:
- tnoremap h h
- tnoremap j j
- tnoremap k k
- tnoremap l l
- " Insert mode:
- inoremap h h
- inoremap j j
- inoremap k k
- inoremap l l
- " Visual mode:
- vnoremap h h
- vnoremap j j
- vnoremap k k
- vnoremap l l
- " Normal mode:
- nnoremap h h
- nnoremap j ji
- nnoremap k k
- nnoremap l l
-endif
-set scrolloff=5
-let g:header_auto_add_header = 0
-
-let g:tmux_navigator_no_mappings = 1
-nnoremap :TmuxNavigateLeft
-nnoremap :TmuxNavigateUp
-nnoremap :TmuxNavigatePrevious
-
-" backward
-noremap \ ,
-let g:polyglot_disabled = ['markdown']
-
-" buf tab
-let g:airline#extensions#tabline#enabled = 1
-let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
-let g:airline#extensions#tabline#show_tab_nr = 1
-let g:airline#extensions#tabline#formatter = 'default'
-let g:airline#extensions#tabline#buffer_nr_show = 0
-let g:airline#extensions#tabline#fnametruncate = 16
-let g:airline#extensions#tabline#fnamecollapse = 2
-let g:airline#extensions#tabline#buffer_idx_mode = 1
-nmap 1 AirlineSelectTab1
-nmap 2 AirlineSelectTab2
-nmap 3 AirlineSelectTab3
-nmap 4 AirlineSelectTab4
-nmap 5 AirlineSelectTab5
-nmap 6 AirlineSelectTab6
-nmap 7 AirlineSelectTab7
-nmap 8 AirlineSelectTab8
-nmap 9 AirlineSelectTab9
-command! -bang -nargs=* Rg
- \ call fzf#vim#grep(
- \ 'rg --column --line-number --hidden --ignore-case --ignore-file ~/.fzf_ignore --no-heading --color=always '., 1,
- \ 0 ? fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'up:60%')
- \ : fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'right:50%:hidden', '?'),
- \ 0)
-nnoremap a :Rg
-if has("persistent_undo")
- set undodir=~/.undodir/
- set undofile
-endif
-" tab 替换为4个空格
-set tabstop=4
-set shiftwidth=4
-set expandtab
-
-" Append modeline after last line in buffer.
-" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX
-" files.
-function! AppendModeline()
- let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :",
- \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
- let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
- call append(line("$"), l:modeline)
-endfunction
-nnoremap ml :call AppendModeline()
-" add current file to ignore file
-command Gg call system('echo '.expand("%"). '>> .git/info/exclude')
-" remove current file from ignore file
-command Gr call system('sed -i "s#'.expand("%").'##g" .git/info/exclude')
-fu! s:isdir(dir) abort
- return !empty(a:dir) && (isdirectory(a:dir) ||
- \ (!empty($SYSTEMDRIVE) && isdirectory('/'.tolower($SYSTEMDRIVE[0]).a:dir)))
-endfu
-set foldmethod=manual
-
-let s:bot = {
-\ 'name': 'bot',
-\ 'set_all': ['nonu', 'nornu'],
-\ 'bot':
-\ {
-\ 'h_sz': 12,
-\ 'init': [ 'term zsh' ]
-\ }
-\ }
-
-let g:vwm#layouts = [s:bot]
-"https://github.com/Shougo/deoplete.nvim/issues/440
-let g:deoplete#enable_at_startup = 1
-" : completion.
-inoremap pumvisible() ? "\" : "\"
-let g:deoplete#auto_complete_delay = 150
-let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{})
-autocmd FileType dot let g:deoplete#omni#input_patterns.dot = '\w+|[^. *\t][.:]\w*'
-"defx
-augroup vimrc_defx
- autocmd!
- autocmd FileType defx call s:defx_my_settings() "Defx mappings
- autocmd VimEnter * call s:setup_defx()
-augroup END
-let s:default_columns = 'indent:git:icons:filename'
-function! s:setup_defx() abort
- call defx#custom#option('_', {
- \ 'columns': s:default_columns,
- \ 'show_ignored_files': 0,
- \ 'buffer_name': '',
- \ 'toggle': 1,
- \ 'resume': 1,
- \ })
-
- call defx#custom#column('filename', {
- \ 'min_width': 80,
- \ 'max_width': 80,
- \ })
- call s:defx_open()
-endfunction
-
-function! s:defx_open(...) abort
- sil! au! FileExplorer *
- if s:isdir(expand('%')) | bd | exe 'Defx' | endif
-endfunction
-
-function! s:defx_my_settings() abort
- " Define mappings
- nnoremap
- \ defx#do_action('open')
- nnoremap c
- \ defx#do_action('copy')
- nnoremap m
- \ defx#do_action('move')
- nnoremap p
- \ defx#do_action('paste')
- nnoremap l
- \ defx#do_action('open')
- nnoremap E
- \ defx#do_action('open', 'vsplit')
- nnoremap P
- \ defx#do_action('open', 'pedit')
- nnoremap o
- \ defx#do_action('open_or_close_tree')
- nnoremap K
- \ defx#do_action('new_directory')
- nnoremap N
- \ defx#do_action('new_file')
- nnoremap M
- \ defx#do_action('new_multiple_files')
- nnoremap C
- \ defx#do_action('toggle_columns',
- \ 'mark:filename:type:size:time')
- nnoremap S
- \ defx#do_action('toggle_sort', 'time')
- nnoremap d
- \ defx#do_action('remove')
- nnoremap r
- \ defx#do_action('rename')
- nnoremap !
- \ defx#do_action('execute_command')
- nnoremap x
- \ defx#do_action('execute_system')
- nnoremap yy
- \ defx#do_action('yank_path')
- nnoremap .
- \ defx#do_action('toggle_ignored_files')
- nnoremap ;
- \ defx#do_action('repeat')
- nnoremap h
- \ defx#do_action('cd', ['..'])
- nnoremap ~
- \ defx#do_action('cd')
- nnoremap q
- \ defx#do_action('quit')
- nnoremap
- \ defx#do_action('toggle_select') . 'j'
- nnoremap *
- \ defx#do_action('toggle_select_all')
- nnoremap j
- \ line('.') == line('$') ? 'gg' : 'j'
- nnoremap k
- \ line('.') == 1 ? 'G' : 'k'
- nnoremap
- \ defx#do_action('redraw')
- nnoremap
- \ defx#do_action('print')
- nnoremap cd
- \ defx#do_action('change_vim_cwd')
-endfunction
diff --git a/tools/neovim/c_cnt.sh b/tools/neovim/c_cnt.sh
deleted file mode 100755
index e1ebc98..0000000
--- a/tools/neovim/c_cnt.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-trim() {
- local var="$*"
- # remove leading whitespace characters
- var="${var#"${var%%[![:space:]]*}"}"
- # remove trailing whitespace characters
- var="${var%"${var##*[![:space:]]}"}"
- echo -n "$var"
-}
-cnt=$(tail "$1/cscope.out" | grep -e "\.c$" | wc -l)
-trim $cnt
diff --git a/tools/neovim/centos_init.sh b/tools/neovim/centos_init.sh
deleted file mode 100644
index 2f1e8b9..0000000
--- a/tools/neovim/centos_init.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-if [ ! -f /usr/local/bin/vim ];then
- if [ ! -f nvim.appimage ];then
- wget https://github.com/neovim/neovim/releases/download/stable/nvim.appimage
- fi
- sudo chmod u+x nvim.appimage && sudo ./nvim.appimage --appimage-extract
- mkdir -p ~/opt/soft
- sudo mv squashfs-root ~/opt/soft/nvim
- sudo ln -s ~/opt/soft/nvim/usr/bin/nvim /usr/local/bin/vim
- rm -rf nvim.appimage
-fi
-sudo pip3 install neovim --upgrade
-sudo pip2 install neovim --upgrade
-pip3 install requests beautifulsoup4
-#-------------------------------------------------------------------------------
-# install vim-plug
-#-------------------------------------------------------------------------------
-if [ ! -f ~/.local/share/nvim/site/autoload/plug.vim ] ; then
- sudo curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
- https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
-fi
-sudo rm -f ~/.config/nvim/base_init.vim
-sudo mkdir -p ~/.config/nvim
-sudo cp tools/neovim/base_init.vim ~/.config/nvim/init.vim
-vim +'PlugInstall --sync' +qall
-
-# copy
-if nmap localhost -p 8377 | grep open 2>/dev/null;then
- sed -in 's#NCHOST#localhost#g' ~/.config/nvim/init.vim
-else
- sed -in 's#NCHOST#host.docker.internal#g' ~/.config/nvim/init.vim
-fi
-
-if [ "$sys_os" == "ubuntu" ];then
- sed -in 's#NCCOMMAND#nc -q 1#g' ~/.config/nvim/init.vim
-else
- sed -in 's#NCCOMMAND#nc -c#g' ~/.config/nvim/init.vim
-fi
-
diff --git a/tools/neovim/cfg.ini b/tools/neovim/cfg.ini
deleted file mode 100644
index e5f6f64..0000000
--- a/tools/neovim/cfg.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-" cus_ini_vim
-let g:header_field_author = 'prozhou'
-let g:header_field_author_email = 'zhoushengzheng@gmail.com'
diff --git a/tools/neovim/coc-settings.json b/tools/neovim/coc-settings.json
index cbe8c23..6558ed0 100644
--- a/tools/neovim/coc-settings.json
+++ b/tools/neovim/coc-settings.json
@@ -1,8 +1,15 @@
{
"suggest.triggerAfterInsertEnter": true,
"suggest.noselect": false,
- "suggest.timeout": 500,
+ "suggest.timeout": 3500,
"suggest.minTriggerInputLength": 2,
"suggest.echodocSupport": true,
+ "languageserver": {
+
+ "test":{
+ "command": "test",
+ "filetypes": ["test"]
+ }
+ },
"suggest.enablePreview": false
}
diff --git a/tools/neovim/del_swap.sh b/tools/neovim/del_swap.sh
deleted file mode 100644
index f5537e8..0000000
--- a/tools/neovim/del_swap.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-# does the swap file exist?
-grep -q "swapfile" /etc/fstab
-
-# if it does then remove it
-if [ $? -eq 0 ]; then
- echo 'swapfile found. Removing swapfile.'
- sed -i '/swapfile/d' /etc/fstab
- echo "3" > /proc/sys/vm/drop_caches
- swapoff -a
- rm -f /swapfile
-else
- echo 'No swapfile found. No changes made.'
-fi
-
-# output results to terminal
-cat /proc/swaps
-cat /proc/meminfo | grep Swap
diff --git a/tools/neovim/env.ini b/tools/neovim/env.ini
deleted file mode 100644
index 9237a5e..0000000
--- a/tools/neovim/env.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-#cus_ini_env
-alias vim="nvim"
-alias vi="nvim"
-alias gdb="gdb -q"
-
diff --git a/tools/neovim/gdbinit b/tools/neovim/gdbinit
deleted file mode 100644
index 88e7caf..0000000
--- a/tools/neovim/gdbinit
+++ /dev/null
@@ -1,2 +0,0 @@
-set confirm off
-set pagination off
diff --git a/tools/neovim/genUrl.sh b/tools/neovim/genUrl.sh
deleted file mode 100644
index 745dbc8..0000000
--- a/tools/neovim/genUrl.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-# check file
-[ ! -f "$1" ] &&
- exit 0
-git_path="$HOME/.local/share/nvim/plugged/"
-git_repo="git@github.com:zhoupro/images.git"
-repo_name="images"
-github_prefix="https://raw.githubusercontent.com/zhoupro/images/master"
-old_path=$(pwd)
-cur_date=$(date +"%Y%m%d")
-file_name=$(basename "$1")
-
-if [ ! -d "$git_path/$repo_name/.git" ]
-then
- cd $git_path
- git clone --quiet $git_repo
- cd $old_path
-fi
-cd "$git_path/$repo_name" && \
-ls | grep -v $cur_date | xargs rm -rf &&\
-cd "$old_path"
-
-if [ -f "$git_path/$repo_name/$cur_date/$file_name" ]
-then
- echo "$github_prefix/$cur_date/$file_name"
- exit 0
-fi
-mkdir -p $git_path/$repo_name/$cur_date
-cp $1 $git_path/$repo_name/$cur_date
-cd $git_path/$repo_name && \
-git add "$cur_date" > /dev/null &&\
-git commit -m "$cur_date $file_name" >/dev/null &&\
-git push --quiet origin master &&\
-cd $old_path
-echo "$github_prefix/$cur_date/$file_name"
diff --git a/tools/neovim/init.vim b/tools/neovim/init.vim
index 5c92f38..c10de6c 100755
--- a/tools/neovim/init.vim
+++ b/tools/neovim/init.vim
@@ -1,75 +1,54 @@
call plug#begin('~/.local/share/nvim/plugged')
+
+ Plug 'honza/vim-snippets'
+
+ Plug 'morhetz/gruvbox'
+
+ Plug 'tpope/vim-commentary'
+
"complete
- Plug 'neoclide/coc.nvim', {'branch': 'release'}
- "outline
+ Plug 'neoclide/coc.nvim', {'branch': 'release'}
+
+ Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
+ Plug 'kristijanhusak/defx-icons'
+ Plug 'kristijanhusak/defx-git'
+
+ " explore
+ Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
+ Plug 'junegunn/fzf.vim'
+
+ Plug 'puremourning/vimspector'
+
Plug 'majutsushi/tagbar'
+
+ "outline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
- " explore
- if has('nvim')
- Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
- else
- Plug 'Shougo/defx.nvim'
- Plug 'roxma/nvim-yarp'
- Plug 'roxma/vim-hug-neovim-rpc'
- endif
- Plug 'kristijanhusak/defx-icons'
- Plug 'kristijanhusak/defx-git'
- Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
- Plug 'junegunn/fzf.vim'
+
Plug 'vim-scripts/ctags.vim'
- Plug 'tpope/vim-commentary'
"git
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
- Plug 'gregsexton/gitv'
- " transform
+
+
+ Plug 'wellle/targets.vim'
+ Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
- " snips
- Plug 'SirVer/ultisnips'
- Plug 'honza/vim-snippets'
- " 语言语法高亮
- Plug 'sheerun/vim-polyglot'
- " num rep
- Plug 'glts/vim-magnum'
- Plug 'glts/vim-radical'
- " mru
- Plug 'vim-scripts/mru.vim'
- " start screen
- Plug 'mhinz/vim-startify'
- " add header
- Plug 'alpertuna/vim-header'
- " select
- Plug 'terryma/vim-expand-region'
- "nginx
- Plug 'chr4/nginx.vim'
- " icon
- Plug 'ryanoasis/vim-devicons'
- " tmux
- Plug 'christoomey/vim-tmux-navigator'
- " emmet
- Plug 'mattn/emmet-vim'
- "indent
- Plug 'Yggdroot/indentLine'
- "undo
- Plug 'mbbill/undotree'
- Plug 'wellle/targets.vim'
- Plug 'forevernull/vim-json-format'
- Plug 'paroxayte/vwm.vim'
- Plug 'jiangmiao/auto-pairs'
+
+ Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
+
+
call plug#end()
+
" our will be the space key
let mapleader=","
set noswapfile
-map js :call json_format#parse("l")
" : completion.
inoremap