ubuntu 12.10安裝后需要做的那些事



一 安裝ubntu-tweak,現在(2013.1.7)最新版本0.8.3
下載:http://ubuntu-tweak.com/
雙擊安裝或者在終端輸入:sudo dpkg -i ubuntu-tweak_0.8.3-1~precise1_all.deb

二 A卡驅動安裝
我電腦顯卡是AMD Radeon HD 4500,最新的A卡驅動12.12版本不支持AMD Radeon HD 2xxx-4xxx series系列的顯卡,所以選擇驅動12.6版本,
驅動最后要安裝,否則電腦的CPU散熱風扇會一直狂轉,安裝前需要安裝一些支持程序
sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms
libqtgui4 wget execstack libelfg0 dh-modaliases linux-headers-generic
然后接着安裝驅動
sudo add-apt-repository ppa:makson96/fglrx
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fglrx-legacy
如果出問題卸載方法
sudo apt-get install ppa-purge
sudo ppa-purge ppa:makson96/fglrx

節能配置
sudo aticonfig --initial
然后
sudo gedit /etc/X11/xorg.conf
在Section "Device"段添加
代碼:
Option     "DynamicClocks"     "on"     # 動態變頻節能, 適用於筆記本
Option     "ClockGating"        "on" # 動態變頻節能,
Option     "ForceLowPowerMode"  "on" #強制GPU使用最低頻率, 可用於筆記本夏季降溫

其他系列的A卡驅動可到官網下載,並查看驅動支持的哪些版本的A卡
http://sites.amd.com/cn/game/downloads/Pages/downloads.aspx

三 安裝ClassicMenu Indicator
安裝命令:
sudo apt-add-repository ppa:diesch/testing
sudo apt-get update
sudo apt-get install classicmenu-indicator

四 安裝Indicator-Sysmonitor
sudo add-apt-repository ppa:alexeftimie/ppa
sudo apt-get update
sudo apt-get install indicator-sysmonitor
要顯示網速,還需要安裝dstat
sudo apt-get install dstat


下載腳本
mkdir -p ~/.scripts && cd ~/.scripts
wget http://webupd8.googlecode.com/files/sysmon_0.2.tar.gz && tar -xvf sysmon_0.2.tar.gz
可在scripts目錄下得到sysmon腳本,設置System Monitor,讓它使用腳本里的配置。
下面 Alt+F2 或終端中 運行indicator-sysmonitor。在工具欄點擊Indicator-Sysmonitor 並選擇 "首選項" ,
選擇Advanced,然后新建一個senor,在command處輸入$HOME/.scripts/sysmon,
在General中勾選“Run on startup” 后保存退出,如果出錯,則在 ".config"目錄中新建一個名為autostart的目錄,

然后再勾選“Run on startup”,在/etc/xdg/autostart文件夾和/etc/xdg/autostart文件夾中存放的是開機啟動程序的.desktop文件,

可以到這些文件夾中修改已存在的文件或者自己添加自動啟動程序的desktop文件

我是把sysmon文件中的setting修改了一下,只顯示網速

1 #settings:
2 netspeed=true
3 ram=false
4 cpu=false

五 vim的安裝和配置

命令:sudo apt-get install vim
配置vim支持C/C++的自動補全
(1)安裝ctags:sudo apt-get install ctags
下載插件clang:http://www.vim.org/scripts/script.php?script_id=3302

在使用clang插件之前先安裝LLVM,Clang,下載:http://llvm.org/releases/ 或者 http://download.csdn.net/detail/bizhu12/5188110

clang : http://download.csdn.net/detail/bizhu12/5188097

如果下載的是源碼,則將Clang的源碼放到LLVM目錄下的tools里,然后回到LLVM目錄下執行

./configure  接着執行 make ,完成后執行 make install  

下載cpp_src,支持STL補全:http://www.vim.org/scripts/script.php?script_id=2358
解壓后復制到/usr/include/c++中,然后使用ctags生成tags文件:
sudo ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ . (后面有個. ,表示當前目錄)
然后退到include文件夾中
sudo ctags -R .
然后在 .vimrc文件中加入
set tags+=/usr/include/tags
set tags+=/usr/include/c++/tags
(2)安裝:vim clang_complete.vmb -c 'so %' -c 'q'(使用vim打開clang_complete.vmb)
最后會在 .vim文件夾中發現clang_complete相關的文件,這個插件要比omnicomplete插件好多了
這兩個插件不能同時存在,要使用omnicomplete插件的話,安裝教程:http://www.cnblogs.com/xkfz007/articles/2501888.html
在vim的配置文件中 .vimrc中

1 let g:clang_complete_auto=1
2 let g:clang_complete_copen=1
3 let g:clang_periodic_quickfix=0
4 let g:clang_snippets=1
5 let g:clang_close_preview=1
6 let g:clang_user_options='-IIncludePath'
7 let g:clang_complete_macros=1
8 let g:clang_hl_errors=1
9 let g:clang_complete_patterns=1

 

其他配置選項可以看它的幫助文檔
(3)安裝SuperTab,支持Tab健補全
下載:http://www.vim.org/scripts/script.php?script_id=1643
安裝:
1. Download supertab.vmb to any directory.
2. Open the file in vim ($ vim supertab.vmb).
3. Source the file (:so %).

我的 .vimrc文件

  1 set iskeyword+=_,$,@,%,#,-
  2 set t_Co=256
  3 set number
  4 "set guifont=WenQuanYi Micro Hei Mono\ 10.0
  5 "set guifontset=Microsoft\ YaHei\ 11
  6 set wildmenu
  7 set backupcopy=yes
  8 set nobackup 
  9 set autochdir
 10 set magic
 11 set autowrite
 12 "set cursorline
 13 "colorscheme desert
 14 "colorscheme   neon
 15 set showmatch
 16 " 使回格鍵(backspace)正常處理indent, eol, start等
 17 
 18 set backspace=indent,eol,start
 19 
 20 " 允許backspace和光標鍵跨越行邊界
 21 autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>
 22 
 23 language messages zh_CN.utf-8
 24 let &termencoding=&encoding
 25 set fileencodings=utf-8,gbk
 26 set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
 27 
 28 set whichwrap+=<,>,h,l
 29 " 可以在buffer的任何地方使用鼠標(類似office中在工作區雙擊鼠標定位)
 30 set viminfo+=!
 31 set mouse=a
 32 
 33 set nowrap
 34 set selection=exclusive
 35 
 36 set selectmode=mouse,key
 37 
 38 "不要使用vi的鍵盤模式,而是vim自己的
 39 
 40 set nocompatible
 41 
 42 " 設置當文件被改動時自動載入
 43  set autoread
 44 
 45 " 去掉輸入錯誤的提示聲音
 46 
 47 set noeb
 48 
 49 " 在處理未保存或只讀文件的時候,彈出確認
 50 
 51 set confirm
 52 
 53 "//
 54 "在編輯過程中,在右下角顯示光標位置的狀態行
 55 set ruler
 56 ""默認情況下,尋找匹配是高亮度顯示的,該設置關閉高亮顯示
 57 set nohls
 58 
 59 "設置匹配模式,類似當輸入一個左括號時會匹配相應的那個右括號
 60 set showmatch
 61 "//
 62 
 63 " 在行和段開始處使用制表符
 64 set smartcase
 65 set smartindent
 66 set smarttab
 67 set wildmode=list:full
 68 set noscrollbind
 69 set ignorecase
 70 set hlsearch
 71 filetype plugin on
 72 filetype indent on
 73 set autoread
 74 filetype plugin indent on
 75 
 76 let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
 77 
 78 
 79   
 80 nnoremap <C-TAB> :tabnext<CR>
 81 nnoremap <C-S-TAB> :tabprev<CR>
 82 nnoremap <silent><F3> :NERDTree  <CR>
 83 "保存
 84 "
 85 map <F2> :call Save()<CR>
 86 func! Save()
 87     if (&filetype=="c" || &filetype == "cpp" || &filetype=="h")
 88     exec "w"
 89     exec "!ctags -f ~/.tags -R *.c *.cpp *.h"
 90         else
 91         exec "w"
 92     endif
 93 endfunc
 94 
 95 
 96 
 97 
 98 "inoremap <F8> <C-x><C-o>
 99 set updatetime=100
100 let g:SuperTabRetainCompletionType=0
101 "let g:SuperTabDefaultCompletionType="context"
102 let g:SuperTabDefaultCompletionType="<C-X><C-U>"
103 
104 
105 au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
106 set completeopt=menuone,menu,longest ",preview
107 
108 let g:AutoComplPop_NotEnableAtStartup = 1
109 let g:AutoComplPop_IgnoreCaseOption=1
110 set ignorecase
111 
112 highlight Pmenu  ctermbg=white ctermfg=black
113 highlight PmenuSel ctermbg=blue ctermfg=black
114 
115 let g:clang_complete_auto=1
116 let g:clang_complete_copen=1
117 let g:clang_periodic_quickfix=0
118 let g:clang_snippets=0
119 let g:clang_close_preview=1
120 "let g:clang_use_library=1
121 let g:clang_user_options='-IIncludePath'
122 let g:clang_complete_macros=1
123 let g:clang_hl_errors=1
124 let g:clang_complete_patterns=1
125 
126 set nocp
127 
128 set nocompatible
129 filetype plugin on 
130 
131 
132 
133 " <TAB> completion.
134 inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
135 map <Leader><TAB>en :NeoComplCacheEnable<CR>
136  " snippets expand key
137 "imap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
138 "smap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
139 set tags+=/usr/include/tags
140 set tags+=/usr/include/c++/tags
141 
142 "map <C-F9> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
143 
144 " F5編譯C/C++程序
145 
146  map <F5> :call CompileRunGcc()<CR>
147  func! CompileRunGcc()
148  exec "w"
149 " exec "!rm -f %<.o"
150  if &filetype == "c"
151      exec "!gcc -Wall -lm % -o %<.o -I . "
152  elseif &filetype == "cpp"
153          exec "!g++ -Wall -lm % -o %<.o -I .  " 
154  endif
155  "exec "!echo % 文件編譯完成"
156  endfunc
157  "F6執行
158  map <F6> :call RunApp()<CR>
159  func! RunApp() 
160  exec "! ./%<.o"
161  endfunc
162  "F7調試
163  map <S-F6> :call AppDebug()<CR>
164  func! AppDebug()
165  exec "w"
166  exec "!rm -f %<.o"
167  if &filetype == "c"
168      exec "!gcc -g % -o %<.o -I . "
169  elseif &filetype == "cpp"
170      exec "!g++ -g % -o %<.o -I .  "
171  endif
172  exec "!gdb %<.o"
173  endfunc
174 
175 " 在輸入模式下移動光標,徹底拋棄方向鍵
176 inoremap <C-h> <left>
177 inoremap <C-j> <C-o>gj
178 inoremap <C-k> <C-o>gk
179 inoremap <C-l> <Right>
180 inoremap <M-h> <C-o>b
181 inoremap <M-l> <C-o>w
182 inoremap <C-a> <Home>
183 inoremap <C-e> <End>
184 
185 
186 autocmd FileType c  map <buffer> <leader><space> :w<cr>:make<cr>
187 map <F7> :w <CR> :make<CR> :copen<CR><CR>
188 map <C-F7> :call OpenWin()<CR>
189 let g:isopen = 1
190 func! OpenWin()
191      if g:isopen == 0
192              let g:isopen = 1
193          exec "cw"
194      elseif g:isopen == 1
195          let g:isopen = 0
196          exec "cclose"
197      endif
198 endfunc
199 
200 hi Number    ctermfg=darkcyan
201 hi Comment    ctermfg=blue

 

六 終端命令行的顏色
在.bashrc文件添加
PS1='${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[00;34m\]\w\[\033[00m\]\$ '

它們分別是30 (黑色)、31 (紅色)、32 (綠色)、33 (黃色)、34 (藍色)、35 ( 紫紅色)、36 (青色)和37 (白色)。對於底色也有8種顏色可供選擇,只需要將字體顏色的3修改為4即可,例如40、41、42、43、44、45、46、47。

 

 

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM