반응형

MacVim

윈도우로 개발 환경을 오래 하다보니 Win+R notepad 이 명령이 일하다가 잠깐 잠깐 노트할 때마다 손에 익어 있는 명령이다. 근데 맥으로 오면서 이렇게 instant하게 사용할만한 노트 메모를 적절하게 느껴지는 앱을 만나기 어려웠는데, 사실 노트를 할 때에는 마우스의 개입이 거의 필요없다보니, 제일 적절한건 vim이다. vim은 C/C++ 개발하기에도 좋지만, 마우스의 개입 없이 텍스트 기반에서는 이리 저리 널뛰며 regex 몇가지로 상당히 간편하고 빠르고 편리하게 문서 수정 및 작성이 용이하여 제일 애정한다. vim은 상당히 오래된 툴로, 각 OS버전별로 무료로 사용이 가능하다.

Default

처음 Default 설정은 뭔가... 심플하면서도... 너무 글씨도 작고... 뭔가 마음에 안든다.

Default 설정 변경

기본적으로 Vim의 설정은 ${HOME}/.vimrc 에 설정을 할 수 있다.
Mac에서도 동일하다. 간편히 vi ~/.vimrc를 추가하면 된다.
기본적으로 사용하는 syntaxt, hightlight search, auto indent, font size, colorscheme, tabsize, line number 등등등을 추가했다.

if has("gui_running")
  set guifont=Menlo:h20
  syntax on
  set hlsearch
  colorscheme darkblue
  set bs=2
  set smartindent
  set tabstop=2
  set extandtab
  set shiftwidth=2
  set ai
  set ruler
  set nu
endif

 

반응형
반응형

1. vundle download

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

 

2. vim resource 파일 수정

filetype off                   " required!
set shell=/bin/bash
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
" required! 
Plugin 'VundleVim/Vundle.vim'

" vim 하단에 파일 정보 띄우기
Plugin 'vim-airline/vim-airline' 
Plugin 'vim-airline/vim-airline-themes'
" ...

call vundle#end()

filetype plugin indent on     " required!
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..

 

3. Plugin 설치

$ vim
: PluginInstall

 

반응형
반응형



1. Vuldle

call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'The-NERD-tree'

Plugin 'ctrlpvim/ctrlp.vim'

call vundle#end()



2. Function Mapping
map <F2> :ToggleBufExplorer<CR>
map <F7> :NERDTreeToggle<CR>


3. Tab and Space Optimize 

highlight ExtraWhiteSpace ctermbg=red guibg=red    "Extra White Space 빨간색 표시

match ExtraWhiteSpace /\s\+$/                            

set list listchars=tab:→\                                        "Tab 문자 화살표 표시


4. CtrlP 옵션

let g:ctrlp_custom_ignore = {

  \ 'dir':  '\v[\/](\.(git|hg|svn)|\_site)$',

  \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg|o)$',

\}


let g:ctrlp_by_filename = 1

let g:ctrlp_regexp = 1

let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:100,results:100'

let g:ctrlp_max_files = 0


let g:ctrlp_working_path_mode = ''


let g:ctrlp_max_files = 0


let g:ctrlp_working_path_mode = 0


set wildignore+=*/tags


5. ETC...
set nu
set softtabstop=4
set tabstop=4
set shiftwidth=4
set expandtab
set hls
syntax on





VIM이 젤조음


반응형

+ Recent posts