当前位置:  开发笔记 > 编程语言 > 正文

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

如何解决《你会给Vim退伍军人哪个.emacs-file?》经验,为你挑选了1个好方法。

我用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中有哪些内容可以让我拥有上述某些功能?



1> Charlie Mart..:

该EMACS入门套件是也有帮助.

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

好的,这里有一些其他的:

设置smartindent
设置autoindent

在编程模式中自动化.对于文本模式,请查看"autoindent-mode"和"filladapt".

set tabstop = 4
set shiftwidth = 3
set 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

(对于shiftwidth来说,没有简单的等价物; EMACS使用更智能的自动压缩算法.

设置expandtab

(setq indent-tabs-mode nil)

设定号码

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

语法

 (turn-on-font-lock)

设置游标线

有一堆光标设置,通过Mx apropos光标查看

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

推荐阅读
mobiledu2402851373
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有