Quantcast
Channel: Vimタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 5657

必要最低限のVimの設定

$
0
0

はじめに

個人的に気に入ってる必要最低限のVimの設定を共有します。
個人的な必要最低限なので、もっと機能を追加するといいでしょう。
(私は普段VSCodeを使ってますが...。)

vimrc

sudo vim /etc/vim/vimrc

vimrcを開きます。

" /etc/vim/vimrc" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by" the call to :runtime you can find below.  If you wish to change any of those" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim" will be overwritten everytime an upgrade of the vim packages is performed." It is recommended to make changes after sourcing debian.vim since it alters" the value of the 'compatible' option.

runtime! debian.vim" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc." This happens after /etc/vim/vimrc(.local) are loaded, so it will override" any settings in these files." If you don't want that to happen, uncomment the below line to prevent" defaults.vim from being loaded." let g:skip_defaults_vim = 1" Uncomment the next line to make Vim more Vi-compatible" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous" options, so any other options should be set AFTER setting 'compatible'."set compatible" Vim5 and later versions support syntax highlighting. Uncommenting the next" line enables syntax highlighting by default.
syntax on" If using a dark background within the editing area and syntax highlighting" turn on this option as wellset background=dark" Uncomment the following to have Vim jump to the last position when" reopening a file"au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif" Uncomment the following to have Vim load indentation rules and plugins" according to the detected filetype.filetype plugin indent on" The following are commented out as they cause vim to behave a lot" differently from regular Vi. They are highly recommended though."set showcmd        " Show (partial) command in status line."set showmatch      " Show matching brackets."set ignorecase     " Do case insensitive matching"set smartcase      " Do smart case matching"set incsearch      " Incremental search"set autowrite      " Automatically save before commands like :next and :make"set hidden     " Hide buffers when they are abandoned"set mouse=a        " Enable mouse usage (all modes)" Source a global configuration file if availableif filereadable("/etc/vim/vimrc.local")
    source /etc/vim/vimrc.local
endif" 以下は、編集をしやすくする機能です。setnumberset title
set expandtab
set shiftwidth=4set softtabstop=4set tabstop=4set autoindent

" 以下は、編集中のファイルについていろいろ表示してくれる機能です。set statusline=%F
set statusline+=%mset statusline+=%rset statusline+=%hset statusline+=%wset statusline+=%=set statusline+=[ENC=%{&fileencoding}]set statusline+=[LOW=%l/%L]set laststatus=2" デフォルトのカラースキームの中で、私が一番ましだと感じたカラースキームです。colorscheme murphy

vimrcはこちらからダウンロードできます。
https://gist.github.com/GuiltyWorks/e73a34f7715334391fe68497f13e0876


Viewing all articles
Browse latest Browse all 5657

Trending Articles