因爲準備把我的電腦的總體環境轉到Linux下,因此準備作一個記錄來記錄在Linux下要配置的一些奇奇怪怪的插件或者環境。考慮到之後工做中可能會沒有su權限,因此總體安裝儘可能採用源碼編譯的方式,但會比較吃配置,有些狀況下編譯仍是比較花時間的,儘可能不要在虛擬機中。html
原文地址
有可能會出現的問題:python
You may need to install a package called 'curses-devel' or 'ncurses-devel' on your system.
相關內容
通常狀況下都會有這個庫,也能夠採用源碼安裝方式:linklinux
在最後的設置成默認的shell中個人作法和原博主有些不同,我修改了~/.bashrc中相關內容,即啓動bash後再啓動zsh
默認的zsh是不顯示絕對路徑只顯示當前目錄的名字,這一點比較難受;
修改方法git
原文地址
固然原博主安裝的位置有一丟丟的奇怪,因此能夠在./configure的時候把安裝位置修改到一個合適的位置。
tmux比較簡單,安裝好了應該沒什麼須要額外配置的了,固然有興趣的也能夠把按鍵改到順手的地方
記得把tmux加到~/.bashrc 或者 ~/.zshrc中,這樣子每次啓動就是在tmux環境下了
使用教程github
vim確實能夠算整個配置中的大頭了,詳細弄弄花上一成天的時間也不是沒有可能。其中vim裏最煩人的就要算youcompleteme的配置了,個人方法可能並不能所有work。shell
首先咱們須要一個支持python/python3的vim,版本要 >= 7.4.1578
打開vim後直接:version
查看版本
vim
注意python/python3以前要有一個加號,否則須要重裝vim
固然咱們假設之後的工做環境是會主動提供支持python的vim的,否則源碼安裝比較麻煩,就不在這裏展開了bash
apt-get 安裝支持python的vim:
先卸載:sudo apt remove vim
再安裝:sudo apt install vim-nox
app
配置vim第一步:ide
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就安裝完成了。
以後就是重頭戲:
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
至於源碼安裝...
先要安裝libclang
相關教程
而後將編譯好的相關文件(bin,lib,include之類)放入~/ycm_temp/llvm_root_dir
編譯ycm_core:
創建臨時文件夾
cd ~ mkdir ycm_build cd ycm_build
而後編譯:
cmake -G "<generator>" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
generator即指Makefiles
在vimrc中加入let g:ycm_clangd_binary_path = "/path/to/clangd"
配置ycm相關:
在vimrc中加入相關配置:連接
ycm_extra_conf.py:連接
vim nerdtree相關:連接
配色相關:連接
所有配置:
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' Plugin 'Valloric/YouCompleteMe' Plugin 'git://github.com/scrooloose/nerdtree.git' " 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 syntax on set number set softtabstop=4 set shiftwidth=4 set ignorecase color desert set cursorline set cursorcolumn "highlight CursorLine ctermfg=black ctermbg=red "highlight CursorColumn ctermbg=darkGrey " 當光標一段時間保持不動了,就禁用高亮 autocmd cursorhold * set nohlsearch " 當輸入查找命令時,再啓用高亮 noremap n :set hlsearch<cr>n noremap N :set hlsearch<cr>N noremap / :set hlsearch<cr>/ noremap ? :set hlsearch<cr>? noremap * *:set hlsearch<cr> " NERDTree config map <F3> :NERDTreeToggle<CR> autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif "第一條是說使用F3鍵快速調出和隱藏它; "第二條是關閉vim時,若是打開的文件除了NERDTree沒有其餘文件時,它自動關閉,減小屢次按:q!。 "若是想打開vim時自動打開NERDTree,能夠以下設定 "autocmd vimenter * NERDTree " YouCompleteMe " Python Semantic Completion let g:ycm_python_binary_path='/usr/bin/python3' " C family Completion Path let g:ycm_global_ycm_extra_conf='~/.ycm_extra_conf.py' " 跳轉快捷鍵 nnoremap <c-k> :YcmCompleter GoToDeclaration<CR>| nnoremap <c-h> :YcmCompleter GoToDefinition<CR>| nnoremap <c-j> :YcmCompleter GoToDefinitionElseDeclaration<CR>| " 中止提示是否載入本地ycm_extra_conf文件 let g:ycm_confirm_extra_conf=0 " 語法關鍵字補全 let g:ycm_seed_identifiers_with_syntax=1 " 開啓 YCM 基於標籤引擎 let g:ycm_collect_identifiers_from_tags_files=1 " 從第2個鍵入字符就開始羅列匹配項 let g:ycm_min_num_of_chars_for_completion=2 " 在註釋輸入中也能補全 let g:ycm_complete_in_comments=1 " 在字符串輸入中也能補全 let g:ycm_complete_in_strings=1 " 註釋和字符串中的文字也會被收入補全 let g:ycm_collect_identifiers_from_comments_and_strings=1 " 彈出列表時選擇第1項的快捷鍵(默認爲<TAB>和<Down>) let g:ycm_key_list_select_completion=['<C-n>', '<Down>'] " 彈出列表時選擇前1項的快捷鍵(默認爲<S-TAB>和<UP>) let g:ycm_key_list_previous_completion=['<C-p>', '<Up>'] " 主動補全, 默認爲<C-Space> "let g:ycm_key_invoke_completion=['<C-Space>'] " 中止顯示補全列表(防止列表影響視野), 能夠按<C-Space>從新彈出 "let g:ycm_key_list_stop_completion=['<C-y>'] autocmd BufWrite * execute ':s/\s*$//' set tags=tags; set autochdir set fdm=indent