VIM配置檔案與Gnome記錄
阿新 • • 發佈:2018-11-24
無論是使用mac還是各個版本的linux,順手的vim總是必不可少。
在這裡記錄一下自己的vim配置
sudo vim /etc/vim/vimrc
完整版
set nu highlight LineNr ctermfg=gray set tabstop=4 set shiftwidth=4 set smarttab set cindent set nobackup set noswapfile set mouse=a map <F6> :call CR()<CR> func! CR() exec "w" exec "!g++ % −o %<" exec "! ./%<" endfunc imap <c−]> {<cr>}<c−o>O<left><right> map <F2> :call SetTitle()<CR> autocmd BufNewFile *.cpp exec ":call SetTitle()" func SetTitle() let l = 0 let l = l + 1 | call setline(l,'#include <stdio.h>') let l = l + 1 | call setline(l,'#include <string.h>') let l = l + 1 | call setline(l,'#include <iostream>') let l = l + 1 | call setline(l,'#include <algorithm>') let l = l + 1 | call setline(l,'#include <vector>') let l = l + 1 | call setline(l,'#include <queue>') let l = l + 1 | call setline(l,'#include <set>') let l = l + 1 | call setline(l,'#include <map>') let l = l + 1 | call setline(l,'#include <string>') let l = l + 1 | call setline(l,'#include <math.h>') let l = l + 1 | call setline(l,'#include <stdlib.h>') let l = l + 1 | call setline(l,'using namespace std;') let l = l + 1 | call setline(l,'#define _for(i,a,b) for(int i=(a); i<(b); ++i)') let l = l + 1 | call setline(l,'#define _rep(i,a,b) for(int i=(a); i<=(b); ++i)') let l = l + 1 | call setline(l,'#define INIF 0x3f3f3f3f') let l = l + 1 | call setline(l,'int readint() {int x;scanf("%d",&x); return x;}') let l = l + 1 | call setline(l,'') let l = l + 1 | call setline(l,'int main()') let l = l + 1 | call setline(l,'{') let l = l + 1 | call setline(l,' //freopen("in.txt","r",stdin);') let l = l + 1 | call setline(l,' ') let l = l + 1 | call setline(l,' return 0;') let l = l + 1 | call setline(l,'}') endfunc :inoremap ( () :inoremap { {} :inoremap [ []
簡版
syntax on
set nu
highlight LineNr ctermfg=gray
set tabstop=4
set shiftwidth=4
set cin
set mouse=a
順手記一下關於使用Gnome的指令
sudo apt-get update
sudo apt-get install gnome-tweak-tool
# 開shell 主題
sudo apt-get install gnome-shell-extensions
主題網址
主題放在usr/share/themes