'Vim'에 해당되는 글 36건

  1. 2016.04.06 python을 위한...
  2. 2016.03.03 [EXAMPLE] YouCompleteMe - .ycm_extra_conf.py
  3. 2016.02.28 vim regular expression
  4. 2016.02.27 C++ code completion
  5. 2016.02.25 vim 유용한 플러그인 셋팅
  6. 2013.05.12 vim Regular Expression
  7. 2013.03.21 Vundle for Linux
  8. 2013.02.20 Vundle for Windows

python을 위한...

Vim/Plug-Ins 2016. 4. 6. 00:38 |

'Vim > Plug-Ins' 카테고리의 다른 글

[EXAMPLE] YouCompleteMe - .ycm_extra_conf.py  (0) 2016.03.03
vim 유용한 플러그인 셋팅  (0) 2016.02.25
Vundle for Linux  (0) 2013.03.21
Vundle for Windows  (0) 2013.02.20
Plug-in 모음  (0) 2013.02.05
Posted by scii
:
~/Desktop/tmp.py.html
  1 # This file is NOT licensed under the GPLv3, which is the license for the rest
  2 # of YouCompleteMe.
  3 #
  4 # Here's the license text for this file:
  5 #
  6 # This is free and unencumbered software released into the public domain.
  7 #
  8 # Anyone is free to copy, modify, publish, use, compile, sell, or
  9 # distribute this software, either in source code form or as a compiled
 10 # binary, for any purpose, commercial or non-commercial, and by any
 11 # means.
 12 #
 13 # In jurisdictions that recognize copyright laws, the author or authors
 14 # of this software dedicate any and all copyright interest in the
 15 # software to the public domain. We make this dedication for the benefit
 16 # of the public at large and to the detriment of our heirs and
 17 # successors. We intend this dedication to be an overt act of
 18 # relinquishment in perpetuity of all present and future rights to this
 19 # software under copyright law.
 20 #
 21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 22 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 23 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 24 # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 25 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 26 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 27 # OTHER DEALINGS IN THE SOFTWARE.
 28 #
 29 # For more information, please refer to <http://unlicense.org/>
 30 import os
 31 import ycm_core
 32 # These are the compilation flags that will be used in case there's no
 33 # compilation database set (by default, one is not set).
 34 # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
 35 flags = [
 36 '-x', 'c++',
 37 '-Wall',
 38 '-Wextra',
 39 '-fPIE',
 40 '-D_REENTRANT',
 41 '-std=c++1y',
 42 '-stdlib=libc++',
 43 '-ftemplate-depth=8192',
 44 '-fconstexpr-depth=8192',
 45 '-lc++abi',
 46 '-isystem', '/usr/include/c++/v1',
 47 '-isystem', '/usr/local/include',
 48 '-isystem', '/usr/include/x86_64-linux-gnu',
 49 '-isystem', '/usr/include',
 50 '-I', '/usr/local/src/yeppp/1.0.0/library/headers',
 51 '-I', '/usr/local/src/string_view/include/experimental',
 52 '-I', '/usr/local/src/scoped_resource',
 53 '-I', '/usr/local/include/hpx/external',
 54 '-I', '/opt/qt/5.2.2/linux/mkspecs/linux-clang-libc++',
 55 '-I', '/opt/qt/5.2.2/linux/include',
 56 '-I', '/opt/qt/5.2.2/linux/include/QtBluetooth',
 57 '-I', '/opt/qt/5.2.2/linux/include/QtCLucene',
 58 '-I', '/opt/qt/5.2.2/linux/include/QtConcurrent',
 59 '-I', '/opt/qt/5.2.2/linux/include/QtCore',
 60 '-I', '/opt/qt/5.2.2/linux/include/QtDBus',
 61 '-I', '/opt/qt/5.2.2/linux/include/QtDeclarative',
 62 '-I', '/opt/qt/5.2.2/linux/include/QtDesigner',
 63 '-I', '/opt/qt/5.2.2/linux/include/QtDesignerComponents',
 64 '-I', '/opt/qt/5.2.2/linux/include/QtGui',
 65 '-I', '/opt/qt/5.2.2/linux/include/QtHelp',
 66 '-I', '/opt/qt/5.2.2/linux/include/QtMultimedia',
 67 '-I', '/opt/qt/5.2.2/linux/include/QtMultimediaQuick_p',
 68 '-I', '/opt/qt/5.2.2/linux/include/QtMultimediaWidgets',
 69 '-I', '/opt/qt/5.2.2/linux/include/QtNetwork',
 70 '-I', '/opt/qt/5.2.2/linux/include/QtNfc',
 71 '-I', '/opt/qt/5.2.2/linux/include/QtOpenGL',
 72 '-I', '/opt/qt/5.2.2/linux/include/QtOpenGLExtensions',
 73 '-I', '/opt/qt/5.2.2/linux/include/QtPlatformSupport',
 74 '-I', '/opt/qt/5.2.2/linux/include/QtPositioning',
 75 '-I', '/opt/qt/5.2.2/linux/include/QtPrintSupport',
 76 '-I', '/opt/qt/5.2.2/linux/include/QtQml',
 77 '-I', '/opt/qt/5.2.2/linux/include/QtQuick',
 78 '-I', '/opt/qt/5.2.2/linux/include/QtQuickParticles',
 79 '-I', '/opt/qt/5.2.2/linux/include/QtQuickTest',
 80 '-I', '/opt/qt/5.2.2/linux/include/QtScript',
 81 '-I', '/opt/qt/5.2.2/linux/include/QtScriptTools',
 82 '-I', '/opt/qt/5.2.2/linux/include/QtSensors',
 83 '-I', '/opt/qt/5.2.2/linux/include/QtSerialPort',
 84 '-I', '/opt/qt/5.2.2/linux/include/QtSql',
 85 '-I', '/opt/qt/5.2.2/linux/include/QtSvg',
 86 '-I', '/opt/qt/5.2.2/linux/include/QtTest',
 87 '-I', '/opt/qt/5.2.2/linux/include/QtUiTools',
 88 '-I', '/opt/qt/5.2.2/linux/include/QtWebKit',
 89 '-I', '/opt/qt/5.2.2/linux/include/QtWebKitWidgets',
 90 '-I', '/opt/qt/5.2.2/linux/include/QtWidgets',
 91 '-I', '/opt/qt/5.2.2/linux/include/QtX11Extras',
 92 '-I', '/opt/qt/5.2.2/linux/include/QtXml',
 93 '-I', '/opt/qt/5.2.2/linux/include/QtXmlPatterns',
 94 ]
 95 # Set this to the absolute path to the folder (NOT the file!) containing the
 96 # compile_commands.json file to use that instead of 'flags'. See here for
 97 # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
 98 #
 99 # Most projects will NOT need to set this to anything; you can just change the
100 # 'flags' list of compilation flags. Notice that YCM itself uses that approach.
101 compilation_database_folder = ''
102 if os.path.exists( compilation_database_folder ):
103   database = ycm_core.CompilationDatabase( compilation_database_folder )
104 else:
105   database = None
106 SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
107 def DirectoryOfThisScript():
108   return os.path.dirname( os.path.abspath( __file__ ) )
109 def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
110   if not working_directory:
111     return list( flags )
112   new_flags = []
113   make_next_absolute = False
114   path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
115   for flag in flags:
116     new_flag = flag
117     if make_next_absolute:
118       make_next_absolute = False
119       if not flag.startswith( '/' ):
120         new_flag = os.path.join( working_directory, flag )
121     for path_flag in path_flags:
122       if flag == path_flag:
123         make_next_absolute = True
124         break
125       if flag.startswith( path_flag ):
126         path = flag[ len( path_flag ): ]
127         new_flag = path_flag + os.path.join( working_directory, path )
128         break
129     if new_flag:
130       new_flags.append( new_flag )
131   return new_flags
132 def IsHeaderFile( filename ):
133   extension = os.path.splitext( filename )[ 1 ]
134   return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
135 def GetCompilationInfoForFile( filename ):
136   # The compilation_commands.json file generated by CMake does not have entries
137   # for header files. So we do our best by asking the db for flags for a
138   # corresponding source file, if any. If one exists, the flags for that file
139   # should be good enough.
140   if IsHeaderFile( filename ):
141     basename = os.path.splitext( filename )[ 0 ]
142     for extension in SOURCE_EXTENSIONS:
143       replacement_file = basename + extension
144       if os.path.exists( replacement_file ):
145         compilation_info = database.GetCompilationInfoForFile(
146           replacement_file )
147         if compilation_info.compiler_flags_:
148           return compilation_info
149     return None
150   return database.GetCompilationInfoForFile( filename )
151 def FlagsForFile( filename, **kwargs ):
152   if database:
153     # Bear in mind that compilation_info.compiler_flags_ does NOT return a
154     # python list, but a "list-like" StringVec object
155     compilation_info = GetCompilationInfoForFile( filename )
156     if not compilation_info:
157       return None
158     final_flags = MakeRelativePathsInFlagsAbsolute(
159       compilation_info.compiler_flags_,
160       compilation_info.compiler_working_dir_ )
161   else:
162     relative_to = DirectoryOfThisScript()
163     final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
164   return {
165     'flags': final_flags,
166     'do_cache': True
167   }

'Vim > Plug-Ins' 카테고리의 다른 글

python을 위한...  (0) 2016.04.06
vim 유용한 플러그인 셋팅  (0) 2016.02.25
Vundle for Linux  (0) 2013.03.21
Vundle for Windows  (0) 2013.02.20
Plug-in 모음  (0) 2013.02.05
Posted by scii
:

vim regular expression

Vim/Tutorial 2016. 2. 28. 02:16 |

'Vim > Tutorial' 카테고리의 다른 글

C++ code completion  (0) 2016.02.27
vim Regular Expression  (0) 2013.05.12
프로그래밍할 때 유용한 기능  (0) 2013.02.06
반복적인 작업 녹화하기  (0) 2013.02.06
자동화  (0) 2013.02.05
Posted by scii
:

C++ code completion

Vim/Tutorial 2016. 2. 27. 01:55 |

'Vim > Tutorial' 카테고리의 다른 글

vim regular expression  (0) 2016.02.28
vim Regular Expression  (0) 2013.05.12
프로그래밍할 때 유용한 기능  (0) 2013.02.06
반복적인 작업 녹화하기  (0) 2013.02.06
자동화  (0) 2013.02.05
Posted by scii
:

'Vim > Plug-Ins' 카테고리의 다른 글

python을 위한...  (0) 2016.04.06
[EXAMPLE] YouCompleteMe - .ycm_extra_conf.py  (0) 2016.03.03
Vundle for Linux  (0) 2013.03.21
Vundle for Windows  (0) 2013.02.20
Plug-in 모음  (0) 2013.02.05
Posted by scii
:

vim Regular Expression

Vim/Tutorial 2013. 5. 12. 23:32 |


일반적인 정규 표현식(Regular Expression) 이랑 vim 에서 쓰이는 정규 표현식이랑 약간 다른 점이 있다. 

그 중에 가장 크게 다른 점만을 설명하겠다. 


일반적인 정규 표현식에서 탐욕적(greedy) 수량자와 게으른(lazy) 수량자가 있다. 

문법은 이렇게 탐욕적 수량자 뒤에 '?' 를 붙이면 된다. 

하지만 vim에서는 완전히 다른 문법이다. 



Regular Expression

vim Built-in Regular Expression 

  * (0 or more)

 greedy matching 

 * (0 or more) 

 greedy matching 

 + (1 or more) 

 greedy matching 

 \+ (1 or more) 

 greedy matching 

 *? (0 or more) 

 non-greedy matching 

 \{-} (0 or more)

 non-greedy matching 

 +? (1 or more)

 non-greedy matching  

 \{-n,} (1 or more)

 non-greedy matching 





'Vim > Tutorial' 카테고리의 다른 글

vim regular expression  (0) 2016.02.28
C++ code completion  (0) 2016.02.27
프로그래밍할 때 유용한 기능  (0) 2013.02.06
반복적인 작업 녹화하기  (0) 2013.02.06
자동화  (0) 2013.02.05
Posted by scii
:

Vundle for Linux

Vim/Plug-Ins 2013. 3. 21. 15:53 |


리눅스에 번들을 설치하는 것은 윈도우에서 설치하는 것보다 간단하다!!


1. 번들을 사용하기 위해서는 git 을 설치해야 한다.


2. 번들을 다운받는다.


3. .vimrc 파일을 수정한다. My Bundles here: 부분은 내가 쓰려는 것들을 넣은 것이기 때문에 생략해도 된다.


원문 : https://github.com/gmarik/vundle

'Vim > Plug-Ins' 카테고리의 다른 글

[EXAMPLE] YouCompleteMe - .ycm_extra_conf.py  (0) 2016.03.03
vim 유용한 플러그인 셋팅  (0) 2016.02.25
Vundle for Windows  (0) 2013.02.20
Plug-in 모음  (0) 2013.02.05
VIM 자세한 설정  (0) 2013.01.15
Posted by scii
:

Vundle for Windows

Vim/Plug-Ins 2013. 2. 20. 03:19 |

Vundle for Windows 원문

https://github.com/gmarik/vundle/wiki/Vundle-for-Windows


vundle은 플러그인을 관리하는 플러그인이다. 이건 정말 대박이다!!!

vundle을 소개하는 글: http://kldp.org/node/125263



1. windows용 vim에 vundle을 설치하기 위해서는 먼저 windows용 Git 설치가 필요하다.

http://code.google.com/p/msysgit/downloads/list

사진보다 최신것이 있다면, 가장 최신것을 받으면 된다.

다운받고 설치를 한다.


정상적으로 설치가 되었는지 확인하려면 cmd창을 열고 다음과 같이 입력해서 결과를 확인하면 된다.


2. Git를 설치하면 Curl이 기본적으로 설치가 된다. 이를 vundle에서 이용하기 위해서는 curl.cmd라는 이름의 script 파일을 생성해야 한다.

@rem Do not use "echo off" to not affect any child calls.
@setlocal

@rem Get the abolute path to the parent directory, which is assumed to be the
@rem Git installation root.
@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%

@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%

@curl.exe %*

이것을 코딩하기 귀찮은 분은 이 파일을 다운받으면 된다.

gist912993-c64d4a0ec01a11522b5bf0e444d996277ec46185.tar.gz

아니면 여기서 다운받아도 된다. 

https://github.com/gmarik/vundle/wiki/Vundle-for-Windows


생성했거나 다운받은 파일을 C:\Program Files (x86)\Git\cmd 에다가 저장한다. 그리고는 정상적으로 동작하는지 테스트한다.


3. Git을 이용해 vundle plugin을 다운받고 설치한다. 

> cd %USERPROFILE%

> git clone http://github.com/gmarik/vundle.git .vim/bundle/vundle
> gvim _vimrc


4. vundle plugin을 사용하기 위해서 _vimrc 에 다음과 같이 설정한다.

set nocompatible               " be iMproved
 filetype off                   " required!

 set rtp+=~/.vim/bundle/vundle/
 call vundle#rc()

 " let Vundle manage Vundle
 " required! 
 Bundle 'gmarik/vundle'

 " My Bundles here:
 "
 " original repos on github
 Bundle 'tpope/vim-fugitive'
 Bundle 'Lokaltog/vim-easymotion'
 Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
 Bundle 'tpope/vim-rails.git'
 " vim-scripts repos
 Bundle 'L9'
 Bundle 'FuzzyFinder'
 " non github repos
 Bundle 'git://git.wincent.com/command-t.git'
 " ...

 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..


5. 설정이 완료된 후 vim을 재시작 한 후, :BundleInstall 을 실행한다. 그러면 필요한 Bundle이 설치된다.


6. 이제부터는 :BundleSearch 를 입력하면 다음과 같이 설치가 가능한 plugin list가 출력된다.



7. 설치하고 싶은 plugin을 복사해서 _vimrc에 저장한 후, 재시작한다. 그 다음 :BundleInstall을 입력하면 해당 plugin이 설치가 된다.





Vundle 사용 방법


:BundleSearch         왼쪽 창에 설치 가능한 list들을 확인할 수 있다. 

:BundleInstall           리스트에서 확인한 것을 _vimrc에 복사한 후 이 명령을 내리면 설치를 한다.

:BundleInstall!          설치된 것들을 업데이트한다.

:BundleClean           _vimrc에 적어두었던 plugin(Bundle)의 라인을 삭제한다. 그 다음 이 명령을 내리면 해당 plugin이 삭제된다.

:BundleList              설치된 플러그인들의 목록을 왼쪽창에 나타내준다.

'Vim > Plug-Ins' 카테고리의 다른 글

vim 유용한 플러그인 셋팅  (0) 2016.02.25
Vundle for Linux  (0) 2013.03.21
Plug-in 모음  (0) 2013.02.05
VIM 자세한 설정  (0) 2013.01.15
autocomplpop (vim 자동완성 플러그인)  (0) 2012.05.09
Posted by scii
: