Posts Tagged Ubuntu
Ubuntu配置记录-编程环境配置
Posted by twcai in Ubuntu Notes on June 6, 2009
GVIM在今天早上算是做好了最基本的配置,可以拿来写代码做算法题了。上次说到不知道配色文件在哪里配置=,=, 其实这是个小白问题,就在 /usr/share/vim/vim71/colors下面(vim71需要对你安装的gvim版本)。
Netbeans的中文显示问题,也算解决了,具体见下帖 : 安装日文支持以后NetBeans界面的字符乱码。当然,实际上跟日文支持是没有关系的。Netbeans的中文显示问题有很多解决方案,而且并非全部都很有效,所以碰到的话,还是需要都尝试一下。
尽管搞定了中文显示问题,但是netbeans下面的字体显示仍然非常难看,google了下ubuntu中文社区,据说可以通过修改配置文件完成。目前对linux的文件配置机制还不是很熟悉,而且主要还是用gvim来编码,因此把这个问题先暂且搁下。留下一个链接,方便以后解决:[问题][Netbeans] JRE[英文]字体配置问题
继续转强帖:
makefile编写;
两篇很牛的vim使用技巧(1);
两篇很牛的vim使用技巧(2)。
最后分享一下我的gvim配置文件和配色文件代码。
Update at 2010.Apr.13: 这两个文件因为会经常修改,我自己使用的最新版本将会放在DropBox上,随时供需要的人下载。也请路过的大牛多多指教。Download via .vimrc ctw.vim
ps. 如果下载后的配置文件中有^M字符,可以在gvim的命令模式下用下面这个命令来清除
- :%s/[Ctrl-v][Enter]//g
- " $HOME/.vimrc
- " Collected and modified by CTW
- " Basics {
- " 关闭兼容模式
- set nocompatible
- " 设定文件浏览器目录为当前目录
- set bsdir=buffer
- set autochdir
- " 设置编码
- set enc=utf-8
- " 设置文件编码检测类型及支持格式
- set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
- " 指定菜单语言
- set langmenu=zh_CN.UTF-8
- source $VIMRUNTIME/delmenu.vim
- source $VIMRUNTIME/menu.vim
- " 与windows共享剪切板
- set clipboard+=unnamed
- " 键盘操作
- map <up> gk
- map <down> gj
- " 开放光标移动
- set whichwrap=b,s,< ,>,[,]
- " 命令行高度
- set cmdheight=1
- " 中文帮助
- if version > 603
- set helplang=cn
- endif
- " 增强检索功能
- set tags=./tags,./../tags,./**/tags
- " 保存文件格式
- set fileformats=unix
- " }
- " Visual {
- " 设置配色文件
- colo ctw
- " 设置开启语法高亮
- syntax on
- " 设置初始窗体行数列数
- set lines=36
- set columns=124
- " font
- set guifont=Monaco
- " 查找结果高亮度显示
- set hlsearch
- " tab宽度
- set tabstop=4
- set cindent shiftwidth=4
- set autoindent shiftwidth=4
- " }
- " Autocommands {
- " Enable load plugin files
- filetype plugin on
- " 自动补全
- filetype plugin indent on
- " 只在下列文件类型被侦测到的时候显示行号,普通文本文件不显示
- if has("autocmd")
- autocmd FileType xml,html,c,cs,java,perl,shell,sh,bash,cpp,python,vim,php,ruby set number
- autocmd FileType xml,html vmap <c -o> <esc>'<i <!--<ESC>o<esc>'>o-->
- autocmd FileType java,c,cpp,cs vmap <c -o> <esc>'<o /*<ESC>'>o*/
- autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
- autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim
- " Error happend, repair needed
- " autocmd BufReadPost *
- " \ if line("'\"") > 0 && line("'\"") < = line("$") |
- " \ exe "normal g`\"" |
- " \ endif
- endif " has("autocmd")
- " 自动完成
- autocmd FileType python set omnifunc=pythoncomplete#Complete
- autocmd FileType javascrīpt set omnifunc=javascrīptcomplete#CompleteJS
- autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
- autocmd FileType css set omnifunc=csscomplete#CompleteCSS
- autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
- autocmd FileType php set omnifunc=phpcomplete#CompletePHP
- autocmd FileType c set omnifunc=ccomplete#Complete
- autocmd FileType java set omnifunc=javacomplete#Complete
- " auto complete
- " inoremap } }<esc>: <cr>O
- " }
- " C/C++ Programming {
- " C/C++注释
- set comments=://
- " Enable OmniCppComplete
- set nocp
- set completeopt=menu
- " Config OmniCppComplete
- " autocomplete with .
- let OmniCpp_MayCompleteDot = 1
- " autocomplete with ->
- let OmniCpp_MayCompleteArrow = 1
- " autocomplete with ::
- let OmniCpp_MayCompleteScope = 1
- " select first item (but don't insert)
- let OmniCpp_SelectFirstItem = 2
- " search namespaces in this and included files
- let OmniCpp_NamespaceSearch = 2
- " show function prototype (i.e. parameters) in popup window
- let OmniCpp_ShowPrototypeInAbbr = 1
- " Add STL tags
- set tags+=~/.myTags/stl.tags
- " 修正自动C式样注释功能 <2005/07/16>
- set comments=s1:/*,mb:*,ex0:/
- " 临时:使用pthread的C源代码的编译
- map <f4> :call PTHCompileRunGPP()<cr>
- func! PTHCompileRunGPP()
- exec "w"
- exec "!gcc -D_REENTRANT % -o %< -g -lpthread"
- endfunc
- " C的编译和运行
- map <f5> :call CCompileRunGpp()</cr><cr>
- func! CCompileRunGpp()
- exec "w"
- exec "!gcc % -o %< -ansi -g -Wall "
- endfunc
- " C++的编译和运行
- map <f6> :call CPPCompileRunGpp()</cr><cr>
- func! CPPCompileRunGpp()
- exec "w"
- exec "!g++ % -o %< -ansi -g -Wall "
- endfunc
- " CTags
- set completeopt=longest,menu
- " TagList
- " 按照名称排序
- let Tlist_Sort_type = "name"
- " 如果只有一个Buffer,kill窗口时也kill掉buffer
- let Tlist_Exit_OnlyWindow = 1
- " 只显示一个文件的Tag
- let Tlist_Show_One_File=1
- " Tlist Auto Open
- let Tlist_Auto_Open=1
- " }
Ubuntu 8.10 配置记录
Posted by twcai in Ubuntu Notes on April 15, 2009
前段时间装了Ubuntu玩玩,用wubi装的,只分配了6G的空间,导致最后空间不足,不能更新,FF也出问题,只好重装。每次装Ubuntu都会忘掉怎么配置,然后上Ubuntu中文社区找东西找来找去,想想干脆自己写个具体的记录,免得下次还这么麻烦。
Ubuntu 8.10的镜像我一直存在移动硬盘上,安装用的wubi(大牛BS我吧,只因为这个比较节省时间=,=)。
安装好后第一件要做的事情就是选择软件源。这次我没有去用第三方源,而是在 软件源 里面使用choose best server 选择了一个最快的官方源 : http://mirror.rootguide.org/ubuntu . 这个源我在教学区基本上都能保持200KB/S以上的下载速度,快的时候有2000+KB/S.
接下来就是安装语言支持和更新, 中间为了能使用闪讯安装了build-essential, cvs.
然后是安装显卡驱动,我的本本用的是 NVIDIA G8400S 显卡, 去官网上下载了驱动后, 按照下面这个帖子进行安装:
Nvidia官方最新180.22显卡驱动安装详解 .
有个需要注意的地方是我用
- sudo /etc/init.d/gdm stop
以后, x-window虽然关闭,但ubuntu并不会自动进入命令行的终端. 而是需要按 ctrl + alt + f1 组合建, 启动终端. Read the rest of this entry »









