vim-zsh-tmux环境配置

由于准备把个人电脑的整体环境转到Linux下,所以准备做一个记录来记录在Linux下要配置的一些奇奇怪怪的插件或者环境。考虑到以后工作中可能会没有su权限,所以整体安装尽量采用源码编译的方式,但会比较吃配置,有些情况下编译还是比较花时间的,尽量不要在虚拟机中。

ZSH

原文地址
有可能会出现的问题:

You may need to install a package called 'curses-devel' or 'ncurses-devel' on your system. 

百度知道相关内容
一般情况下都会有这个库,也可以采用源码安装方式:link

在最后的设置成默认的shell中我的做法和原博主有些不一样,我修改了~/.bashrc中相关内容,即启动bash后再启动zsh
默认的zsh是不显示绝对路径只显示当前目录的名字,这一点比较难受;
修改方法


TMUX

原文地址
当然原博主安装的位置有一丢丢的奇怪,所以可以在./configure的时候把安装位置修改到一个合适的位置。
tmux比较简单,安装好了应该没什么需要额外配置的了,当然有兴趣的也可以把按键改到顺手的地方
记得把tmux加到~/.bashrc 或者 ~/.zshrc中,这样子每次启动就是在tmux环境下了
使用教程


VIM

vim确实可以算整个配置中的大头了,详细弄弄花上一整天的时间也不是没有可能。其中vim里最烦人的就要算youcompleteme的配置了,我的方法可能并不能全部work。

首先我们需要一个支持python/python3的vim,版本要 >= 7.4.1578
打开vim后直接:version查看版本

注意python/python3之前要有一个加号,不然需要重装vim
当然我们假设以后的工作环境是会主动提供支持python的vim的,不然源码安装比较麻烦,就不在这里展开了

apt-get 安装支持python的vim:
先卸载:sudo apt remove vim
再安装:sudo apt install vim-nox

配置vim第一步:

安装Vundle

github地址
教程还是比较详细的,简单来说就是先

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

然后在~/.vimrc最顶上加上这么一段话

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

然后保存,然后:PluginInstall
Vundle就安装完成了。

之后就是重头戏:

YouCompleteMe

github地址
首先,在vundle中加入对应的配置

Plugin 'Valloric/YouCompleteMe'

安装分两种,源码编译安装与apt-get安装
比较简单的apt-get安装:

sudo apt install build-essential cmake python3-dev

装就完事了
之后加上c-family的语义支持

cd ~/.vim/bundle/YouCompleteMe
python3 install.py --clang-completer

至于源码安装...

猜你喜欢

转载自www.cnblogs.com/master-of-blue-pictures/p/10932263.html
今日推荐