你会给Vim退伍军人哪个.emacs -file?

时间:2009-04-12 21:01:28

标签: emacs vim

我用Vim进行编码。 我也想学习Emacs。

我想将.vimrc中至少一些以下自定义项导出到我的.emacs。

我的.vimrc

let Tlist_Auto_Open = 1

" http://stackoverflow.com/questions/165231/vim-dvorak-keybindings-rebinding
" Dvorak it!
no d h
no h j
no t k
no n l
no s :
no S :
no j d
no J D
no l n
no L N
" Added benefits
no - $
no _ ^
no N 
no ; z
no T L
no P P
no p p

let Tex_ViewRuleComplete_pdf = '/usr/bin/open -a Skim $*.pdf' 

set history=1000

set smartindent
set autoindent
set tabstop=4
set expandtab
set shiftwidth=3                                                                                            
set softtabstop=4
set number
set hlsearch
syntax on
set cursorline
highlight CursorLine guibg=#400000
set ruler
set textwidth=78
set foldcolumn=5

" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on 
filetype indent on

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'


" http://ubuntuforums.org/showthread.php?t=74889
set foldmethod=manual "folds by indentation, manual, indent
set nocompatible                "Use Vim extensions
set backspace=indent,eol,start  "More powerful backspacing
set nobackup                    "No backup file
set showmode                    "Tell when in insert mode
set showmatch                   "Show matching () {} etc
set hlsearch                    "Highlight what is searched for
set incsearch                   "Highlight as you type

if &t_Co > 2
  syntax on
endif

set bg=dark
hi clear
if exists("syntax_on")
  syntax reset
endif


"Allowable colors: red, yellow, green, blue, magenta,
"                  cyan, gray, black, gray
hi Normal ctermfg=gray ctermbg=none
hi ErrorMsg ctermfg=gray ctermbg=lightblue
hi Visual ctermfg=lightblue ctermbg=fg cterm=reverse
hi VisualNOS ctermfg=lightblue ctermbg=fg cterm=reverse,underline
hi Todo ctermfg=red ctermbg=darkblue
hi Search ctermfg=gray ctermbg=darkblue
hi IncSearch ctermfg=darkblue ctermbg=gray
hi SpecialKey ctermfg=darkcyan
hi Directory ctermfg=cyan
hi Title ctermfg=magenta cterm=bold
hi WarningMsg ctermfg=red
hi WildMenu ctermfg=yellow ctermbg=black cterm=none
hi ModeMsg ctermfg=lightblue
hi MoreMsg ctermfg=darkgreen ctermfg=darkgreen
hi Question ctermfg=green cterm=none
hi NonText ctermfg=darkblue
hi StatusLine ctermfg=blue ctermbg=gray cterm=none
hi StatusLineNC ctermfg=black ctermbg=gray cterm=none
hi VertSplit ctermfg=black ctermbg=gray cterm=none
"hi Folded ctermfg=darkgrey ctermbg=black cterm=bold
"hi FoldColumn ctermfg=darkgrey ctermbg=black cterm=bold
hi LineNr ctermfg=gray cterm=none
hi DiffAdd ctermbg=darkblue cterm=none
hi DiffChange ctermbg=magenta cterm=none
hi DiffDelete ctermfg=blue ctermbg=cyan
hi DiffText cterm=bold ctermbg=red
hi Cursor ctermbg=brown
hi lCursor ctermbg=darkgreen

hi Comment ctermfg=lightgreen cterm=none
hi Constant ctermfg=cyan cterm=none
hi Identifier ctermfg=gray cterm=none
hi Statement ctermfg=red cterm=none
hi PreProc ctermfg=yellow cterm=bold
hi Type ctermfg=darkyellow cterm=none
hi Special ctermfg=magenta cterm=none
hi Underlined cterm=underline
hi Ignore cterm=none

您的.emacs 中包含哪些内容可以让我拥有上述某些功能?

4 个答案:

答案 0 :(得分:9)

EMACS Starter Kit也很有用。

我的上帝 - 你真的将键盘重新映射到你的.vim中的Dvorak?

好的,以下是其他一些内容:

  

设置smartindent
  设置autoindent

编程模式自动化。对于文本模式,请查看'autoindent-mode'和“filladapt。”

  

设置tabstop = 4
  设置shiftwidth = 3
  设置softtabstop = 4

(setq c-basic-offset 4) ; indents 4 chars
(setq tab-width 4)          ; and 4 char wide for TAB
(setq indent-tabs-mode nil) ; And force use of spaces

(移动宽度并不容易; EMACS使用更智能的自动压缩算法。

  

设置expandtab

(setq indent-tabs-mode nil)
  

设置号码

有一种获得编号线的方法,但我从不使用它而不记得它。

  

上的

语法

 (turn-on-font-lock)
  

设置游标线

有一堆光标设置,通过M-x apropos光标查看

其他一些东西也是可用的,这些是我所知道的事情。

答案 1 :(得分:2)

尝试这些,并进行实验。

dotfiles emacs

dotfiles.org

除了那些,总是一个很好的链接:

GNU Emacs Manuals Online

答案 2 :(得分:2)

对于每个缓冲区,您可以获得带(linum-mode 1)(global-linum-mode 1)的编号行。此功能目前仅在CVS Emacs中。请参阅further choices

要在Emacs中打开PDF文档,有doc-view-mode。有关详细说明,请参阅View PDF/PS/DVI files in an Emacs buffer

无论如何,如果你开始使用Emacs入门套件as Charlie Martin suggested开始学习Emacs,那就更好了,然后找到自己真正缺少的东西。 Emacs世界与Vi不同。您可以随时浏览Stack Overflow以查找您的问题是否已经得到解答。

答案 3 :(得分:2)

你一定要尝试邪恶模式。适用于emacs的最佳vim模拟器: http://www.emacswiki.org/emacs/Evil