๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ :
Error detected while processing /Users/vvqboy/.vimrc:
line 8:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/__init__.py", line 11, in <module>
from powerline.lib.config import ConfigLoader
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/lib/config.py", line 11, in <module>
from powerline.lib.threaded import MultiRunnedThread
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/lib/threaded.py", line 7, in <module>
from powerline.lib.monotonic import monotonic
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/lib/monotonic.py", line 19, in <module>
import ctypes
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 555, in <module>
_reset_cache()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 279, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
line 9:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'powerline_setup' is not defined
line 10:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'powerline_setup' is not defined
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/__init__.py", line 11, in <module>
from powerline.lib.config import ConfigLoader
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/lib/config.py", line 11, in <module>
from powerline.lib.threaded import MultiRunnedThread
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/lib/threaded.py", line 7, in <module>
from powerline.lib.monotonic import monotonic
File "/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/lib/monotonic.py", line 19, in <module>
import ctypes
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 555, in <module>
_reset_cache()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 279, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
An error occurred while importing powerline module.
This could be caused by invalid sys.path setting,
or by an incompatible Python version (powerline requires
Python 2.6, 2.7 or 3.2 and later to work). Please consult
the troubleshooting section in the documentation for
Vim: Caught deadly signal SEGV
Vim: Finished.
[1] 7428 segmentation fault vi .vimrc
๋ค์๊ณผ ๊ฐ์ด vimrc :
set rtp+=/Users/vvqboy/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim
" These lines setup the environment to show graphics and colors correctly.
set nocompatible
set t_Co=256
let g:minBufExplForceSyntaxEnable = 1
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif
set laststatus=2 " Always display the statusline in all windows
set guifont=Inconsolata\ for\ Powerline:h14
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
set nu
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
ํ๋ ค๊ณ ํ๋ค
pip install --upgrade --force-reinstall --user powerline-status
Collecting powerline-status
Downloading https://files.pythonhosted.org/packages/9c/30/8bd3c62642778af9ad813a526c6ff7dd2f98144d6580ad6fab94ca389265/powerline-status-2.7.tar.gz (233kB)
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 235kB 69kB/s
Building wheels for collected packages: powerline-status
Running setup.py bdist_wheel for powerline-status ... done
Stored in directory: /Users/vvqboy/Library/Caches/pip/wheels/c4/81/6b/bb1f440b9999fcfda2a1ccdf7b57a886acb08ea3e9e794945d
Successfully built powerline-status
Installing collected packages: powerline-status
Found existing installation: powerline-status 2.6
Uninstalling powerline-status-2.6:
Successfully uninstalled powerline-status-2.6
Successfully installed powerline-status-2.7
๊ทธ๋ฐ ๋ค์ ์ฌ์ ํ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
Vim: Caught deadly signal SEGV
Error detected while processing /Users/vvqboy/.vimrc:Vim: Finished.
line 8:
Exception MemoryError: MemoryError() in <module 'threading' from '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.pyc'> ignored
[1] 1788 segmentation fault vi .vimrc
ํ์ด์ฌ-๋ฒ์
ํ์ด์ฌ 2.7.10
์ฌ๊ธฐ์๋ ๊ฐ์ ์ค๋ฅ๊ฐ ์์ต๋๋ค. brew๋ฅผ ์ฌ์ฉํ์ฌ ๋ช ๊ฐ์ง ์์ ์ ์๋ํ์ง๋ง (์ฌ๋ณผ ๋งํฌ ๋ฌธ์ ์ผ ์ ์๋ค๊ณ ์๊ฐํ์ต๋๋ค) ๋ชจ๋ ๊ฒ์ด ์ ๋ ๊ฒ ๊ฐ๊ณ ๋ด pyenv๋ ๊ด์ฐฎ์ ๋ณด์ ๋๋ค.
๋ค์์ ๋ด๊ฐ ๋ ๋ฐฐ๋ก ํ์ ํ๋ ์ค๋ฅ์ ๋๋ค (๊ทธ๋ฆฌ๊ณ ์ด๊ฒ์ Moajve ์ ๋ฐ์ดํธ ์ดํ์๋ ๋ฐ์ํ์ต๋๋ค).
An error occurred while importing powerline module.
This could be caused by invalid sys.path setting,
or by an incompatible Python version (powerline requires
Python 2.6, 2.7 or 3.2 and later to work). Please consult
the troubleshooting section in the documentation for
possible solutions.
Error detected while processing
...
line 157:
Traceback (most recent call last):
File "<string>", line 53, in <module>
File "<string>", line 9, in powerline_troubleshoot
File "/Users/.../Library/Python/2.7/lib/python/site-packages/powerline/__init__.py", line 11, in <module>
from powerline.lib.config import ConfigLoader
File "/Users/.../Library/Python/2.7/lib/python/site-packages/powerline/lib/config.py", line 11, in <module>
from powerline.lib.threaded import MultiRunnedThread
File "/Users/.../Library/Python/2.7/lib/python/site-packages/powerline/lib/threaded.py", line 7, in <module>
from powerline.lib.monotonic import monotonic
File "/Users/.../Library/Python/2.7/lib/python/site-packages/powerline/lib/monotonic.py", line 19, in <module>
import ctypes
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 555, in <module>
_reset_cache()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 279, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
ํฅ๋ฏธ๋กญ๊ฒ๋ _actual_ powerline.vim ํ์ผ์ ๊ฒฝ๋ก๋ฅผ ๊ฐ๋ฆฌํค๋ฉด vim์ด ์ ๋๋ก๋ก๋๋๊ณ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง ์์ง๋ง ์ ๋ ฅ์ ๋๋ก๋๋์ง ์์ต๋๋ค.
/Library/Python/2.7/site-packages/powerline/powerline/bindings/vim/plugins/powerline.vim
Vim์ ์ ๋ ฅ์ ์๋ก๋ํ์ง ์๊ณ ํ๋ณตํ๊ฒ ์ซ์ ๋ด๊ณ ์์ต๋๋ค ... ๋ํ ์ tmux conf๋ ์ ๋ ฅ์ ์ ์๋ก๋ํ๋ฏ๋ก ์ด๊ฒ์ด vim-powerline์ ํน์ ํ ๋ฌธ์ ๋ผ๊ณ ์๊ฐํฉ๋๋ค. ๋ช ๊ฐ์ง ์กฐ์ฌ๋ฅผํ๊ณ ๋ค์ ์ฐ๋ฝ ๋๋ฆฌ๊ฒ ์ต๋๋ค.
ํธ์ง : ํ์ด์ฌ์ ์์คํ
๋ฒ์ ์ผ๋ก ์ ํํ๊ณ ๋ํ ํ ์์ ์คํํ๋ฉด ์คํํ ์์์์ต๋๋ค.
๋ฒ๊ฑฐ ๋ก์์์ด from powerline.vim import VimPowerLine
.
์ด๋ค ์ด์ ๋ก ๋ CTYPES ์ค์ ์ฃผ์ ์ฒ๋ฆฌ ํ ์๋ ์์ง๋ง (์ผ๋ถ ๊ถํ ์ค๋ฅ๋ ๋์ค์ ์์ธํ ์กฐ์ฌ ํ ๊ฒ์ ๋๋ค) ์ค์ ๋ก ๋ฉ๋ชจ๋ฆฌ ํ ๋น์ด ์ํ๋๋ ์์ค ํ์ผ์ ์ถ์ ํ ์ ์์ต๋๋ค. ์ด ํ์ผ์ด ์ด๋์ ์๋์ง ์๋ ์ฌ๋์ด ์์ต๋๊น? ์๋๋ฉด ๊ทธ๊ฒ์ด ์ฌ๋ฐ๋ฅธ ์งํ ๋ฐฉ๋ฒ์ธ์ง ์๊ณ ์์ต๋๊น?
Python ๋ฒ์ Vim์ Vim์ด ์ค์ ๋ก ์ฌ์ฉํ๋ Python ๋ฒ์ ๊ณผ ์ผ์นํ๋๋ก ์ปดํ์ผ ๋์์ต๋๊น? ctypes๋ฅผ ๊ฐ์ ธ ์ค๋ ๋์ MemoryError์ SEGV๋ ์ ๋ ฅ์ ๋ฌธ์ ๊ฐ ์๋๋ผ Python ์ค์น ๋ฌธ์ ๋ฅผ ๋ํ๋
๋๋ค. powerline์ ๋นํ์ฑํํ๊ณ vim์์ :python import ctypes
๋ฅผ ์ํํ๋ฉด ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํด์ผํฉ๋๋ค (์ ์ด๋ MemoryError, ์ค์ ๋ก ์๋ฏธํ๋ ๋ฐ๋ ํ์คํ์ง ์์ต๋๋ค : ์๋ง๋ ๋ฉ๋ชจ๋ฆฌ ํ ๋น์๊ฐ NULL์ ๋ฐํํฉ๋๊น?).
๋น๊ณ , ์๋ํ์ง ์์์ต๋๋ค. ๊ทธ๋ฌ๋ MacOS Mojave ์ ๋ฐ์ดํธ ์ ์๋ ์๋ฒฝํ๊ฒ ์๋ํ์ต๋๋ค.
Mojave๋ก ์ ๋ฐ์ดํธ ํ ํ ์ค๋ฅ +1
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/__init__.py", line 11, in <module>
from powerline.lib.config import ConfigLoader
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/lib/config.py", line 11, in <module>
from powerline.lib.threaded import MultiRunnedThread
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/lib/threaded.py", line 7, in <module>
from powerline.lib.monotonic import monotonic
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/lib/monotonic.py", line 19, in <module>
import ctypes
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 555, in <module>
_reset_cache()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 279, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
An error occurred while importing powerline module.
This could be caused by invalid sys.path setting,
or by an incompatible Python version (powerline requires
Python 2.6, 2.7 or 3.2 and later to work). Please consult
the troubleshooting section in the documentation for
possible solutions.
Error detected while processing /usr/local/lib/python2.7/site-packages/powerline/bindings/vim/plugin/powerline.vim:
line 157:
Traceback (most recent call last):
File "<string>", line 53, in <module>
File "<string>", line 9, in powerline_troubleshoot
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/__init__.py", line 11, in <module>
from powerline.lib.config import ConfigLoader
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/lib/config.py", line 11, in <module>
from powerline.lib.threaded import MultiRunnedThread
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/lib/threaded.py", line 7, in <module>
from powerline.lib.monotonic import monotonic
File "/Users/zzs/Library/Python/2.7/lib/python/site-packages/powerline/lib/monotonic.py", line 19, in <module>
import ctypes
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 555, in <module>
_reset_cache()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 279, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
Press ENTER or type command to continue
Python ๋ฒ์ Vim์ Vim์ด ์ค์ ๋ก ์ฌ์ฉํ๋ Python ๋ฒ์ ๊ณผ ์ผ์นํ๋๋ก ์ปดํ์ผ ๋์์ต๋๊น? ctypes๋ฅผ ๊ฐ์ ธ ์ค๋ ๋์ MemoryError์ SEGV๋ ์ ๋ ฅ์ ๋ฌธ์ ๊ฐ ์๋๋ผ Python ์ค์น ๋ฌธ์ ๋ฅผ ๋ํ๋ ๋๋ค. powerline์ ๋นํ์ฑํํ๊ณ vim์์
:python import ctypes
๋ฅผ ์ํํ๋ฉด ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํด์ผํฉ๋๋ค (์ ์ด๋ MemoryError, ์ค์ ๋ก ์๋ฏธํ๋ ๋ฐ๋ ํ์คํ์ง ์์ต๋๋ค : ์๋ง๋ ๋ฉ๋ชจ๋ฆฌ ํ ๋น์๊ฐ NULL์ ๋ฐํํฉ๋๊น?).
๊ทธ๋์ ๊ทธ๊ฒ์ _ ์ ๊ทธ๋ ์ด๋ ์ง์ _ ์ ์๋ํ์ต๋๋ค. ๋ด zsh ๋ฐ tmux ์ค์ ์ ๋ค๋ฅธ ๋ฐ์ธ๋ฉ์ ์ฌ์ฉํ์ฌ ์ ๋๋ก ์๋ํฉ๋๋ค.
vim์์ :python import ctypes
๋ช
๋ น์ ์คํํ ๋ ์์ ๊ฐ์ ์ค๋ฅ (CTYPE ์ค๋ฅ)๊ฐ ๋ฐ์ํฉ๋๋ค. ๋๋ Apple-Python์ ์ถํ ๋ ๋ฒ์ ์์ Apple์ด ๋ฌด์์ ๋ณ๊ฒฝํ๋์ง, ์๋๋ฉด ์ค์ ๋ก ๋ณ๊ฒฝ ํ ๊ฒ์ด ์๋์ง ๊ถ๊ธํฉ๋๋ค. ์ค๋ ๋ฐค ์กฐ๊ธ ํ์ ๋ค์ ์๋ํด ๋ณด๊ฒ ์ต๋๋ค.
Zsh์ tmux๋ ๋ณ๋์ ํ๋ก์ธ์ค์์ Python ์ธํฐํ๋ฆฌํฐ๋ฅผ ์ฌ์ฉํฉ๋๋ค. Vim์ dlopen์ ํตํด Python์ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก๋ก๋ํ๊ฑฐ๋ ๋ ์ทจ์ฝํ ๋งํฌ๋ก๋ง๋ก๋ํฉ๋๋ค. Python ๋ฒ์ ์ ๋ณ๊ฒฝํ๋ฉด ์ ๋ฒ์ ์ผ๋ก Vim์ ๋ค์ ์ปดํ์ผํด์ผํ๊ฑฐ๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ํ์ด ์์ต๋๋ค. ๋ฒ์ ์ ์ฐจ์ด๋ก ์ธํด ctypes ๊ฐ์ ธ ์ค๊ธฐ๊ฐ ๊ทธ๋ ๊ฒ ๋ฆ๊ฒ ์ค์๋ํ๋ ๋ฐฉ๋ฒ์ด ํ์คํ์ง ์์ง๋ง (์ผ๋ฐ์ ์ผ๋ก :python
๊ฐ ์ ํ ์คํ๋์ง ์๊ฑฐ๋ ๋๋ก๋ ์ถฉ๋ ํ ์ ์์) ๊ฐ๋ฅํ ์ค๋ช
์ค ํ๋์
๋๋ค.
๋ ๋ค๋ฅธ ํ๋๋ ์์คํ ๊ณผ ์์ Python ๋ฒ์ ์ ์ฐจ์ด์ ์ ๋๋ค. ์ ๋ Mac์ด์๊ณ ์ด๋ค Vim์ด ๋ ๊ฐ์ง ์ค ์ด๋ ํ๋๋ฅผ๋ก๋ํด์ผํ๋์ง, ์ผ๋ง๋ ์ ํํ ๊ทธ ์์ ์ ์ํํ๋์ง ๋งํ ์ ์์ต๋๋ค.ํ์ง๋ง ์ด๊ฒ์ Mac์์ (app (vim ๋ฑ)) + Python ์ค์ ๋ฌธ์ ์ ๋ํ ๋ ๋ค๋ฅธ ์ผ๋ฐ์ ์ธ ์ค๋ช ์ ๋๋ค. ์์ ์ ๊ฐ์ข ์ค๋ฅ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.
@ ZyX- ๋๋ ์ฐ์ ๊ทธ๊ฒ์ ์ป์๋ค. ํ๋ก์ธ์ค๋ฅผ ์ค๋ช ํ๋ ๋ฌธ์๊ฐ ์์ต๋๊น? ๋๋ ๊ทธ๊ฒ์ด ์ด๋ป๊ฒ ์๋ํ๋์ง ์ ํ ๋ชฐ๋๋ค.
์์คํ ๋ฒ์ ์ผ๋ก vim์ ๋ค์ ์ปดํ์ผํ๊ณ ์ด๋ค ์ผ์ด ๋ฐ์ํ๋์ง ์ดํด ๋ณด๊ฒ ์ต๋๋ค!
ํด๊ฒฐ์ฑ !!
1) ํ์ฌ vim ๋ฒ์ ์ ํ์
ํ์ญ์์ค. Mine์ homebrew๋ก ์ปดํ์ผ๋์ง๋ ์์์ง๋ง Apple์ด Mojave ๋ฆด๋ฆฌ์ค๋ฅผ ์ํด ์ฌ ์ปดํ์ผ ํ ๊ธฐ๋ณธ ์์คํ
๋ฒ์ ์ด์์ต๋๋ค (๋ ์ง๋ณด๊ธฐ). ์ปดํ์ผ ๋ ์ง๋ฅผ ๊ธฐ์ค์ผ๋ก ์ฌ์ ์ง์ ์ด ์ ํํ๋ค๊ณ ์๊ฐํ์ง๋ง ํ๋ฆฌ๋ฉด ์์ ํ์ญ์์ค. vim --version
์คํํ๋ฉด [email protected]
์ํด ์ปดํ์ผ๋์์์ ํ์ธํ ์ ์์ต๋๋ค.
2) brew'd ๋ฒ์ ์ python @ 2 ๋ฅผ ์ ๊ฑฐํ๊ณ brew๋ฅผ ํตํด ํ์ด์ฌ์ ์ค์นํ์ต๋๋ค (์์ฑ ๋น์ ๊ธฐ๋ณธ์ ์ผ๋ก 3.7.0์ ์ค์น ํจ). ๊ทธ๋ฅ ๋๋์ด์ ์ค์น๋์ง ์์ผ๋ฉด brew python์ผ๋ก ์ปดํ์ผ๋์ง ์๋๋ค๋ ํฌ๋ผ์ ์ฝ์ด๋ณด์ญ์์ค. @ ZyX-I ์ด์ฉ๋ฉด ๋น์ ์ด ์ด๊ฒ์ ๋ํด ๋ ์๊ณ ์์ต๋๊น?
3) brew install python
ํ homebrew๋ฅผ ์ฌ์ฉํ์ฌ brew install vim
๋ช
๋ น์ ์ฌ์ฉํ์ฌ vim์ ์ค์นํฉ๋๋ค. ๊ทธ๋ฐ ๋ค์ /usr/local/bin/vim --version
์คํํ๊ณ python3 ์์ '+'๊ธฐํธ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค. ์
ธ์ ๋ค์ ์์ํ๋ฉด /.vimrc๊ฐ /Library/Python/2.7/site-packages/powerline/powerline/bindings/vim/
๋๋ ์ฐพ๊ณ ์๋ ๋๋ ํ ๋ฆฌ๋ฅผ ์ฝ์ด์ผํฉ๋๋ค.
.... ์๋ํด์ผํฉ๋๋ค!
ํธ์ง : ์ผ๋ถ ๋ฌธ๋ฒ, ์ปคํผ์์ด ์ผ์ต๋๋ค.
Mojave๋ก ์
๊ทธ๋ ์ด๋ ํ ๋ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
line 63:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/xxx/Library/Python/2.7/lib/python/site-packages/powerline/__init__.py", line 11, in <module>
from powerline.lib.config import ConfigLoader
File "/Users/xxx/Library/Python/2.7/lib/python/site-packages/powerline/lib/config.py", line 11, in <module>
from powerline.lib.threaded import MultiRunnedThread
File "/Users/xxxx/Library/Python/2.7/lib/python/site-packages/powerline/lib/threaded.py", line 7, in <module>
from powerline.lib.monotonic import monotonic
File "/Users/xxx/Library/Python/2.7/lib/python/site-packages/powerline/lib/monotonic.py", line 19, in <module>
import ctypes
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 555, in <module>
_reset_cache()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 279, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
line 64:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'powerline_setup' is not defined
line 65:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'powerline_setup' is not defined
์์คํ
๊ธฐ๋ณธ ํ์ด์ฌ์ผ๋ก ๋กค๋ฐฑ ํ ํ์๋ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
@zhongruizhi ์์์ ์ ์ํ ๊ฒ์ ์๋ ํ์ต๋๊น? ๋ด ์๋ฃจ์ ์ ๊ฒ์ํ๊ณ ํด๊ฒฐํ์ต๋๋ค!
๋ฟก ๋นต๋จ
๊ฐ์ฌํฉ๋๋ค.ํ์ง๋ง ๊ทํ์ ์๋ฃจ์
์ด ๋ด ์ํ์ ์ ํฉํ์ง ์์ ๊ฒ ๊ฐ์ต๋๋ค. brew๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ์์คํ
์ ๊ธฐ๋ณธ python (2.7.10) ๋ฐ vim. (+ python / dyn -python3)์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
@anirrudh ์ ๋ง ๋๋ฅผ ์ํด ์๋ํฉ๋๋ค, ์ข์ ์๋ฃจ์ , ๋๋จํ ๊ฐ์ฌํฉ๋๋ค
@zhongruizhi ๊ทธ๋์ ์ ๋ Apple์์ ์ ๊ณตํ๋ ํ์ค vim ๋ฒ์ ๋ ๊ฐ์ง๊ณ ์์์ง๋ง ์ ๋ ฅ์ ์ ๋ํด ๊นจ์ง ๊ฒ์ฒ๋ผ ๋ณด์ด๋ฉฐ ์ ์ผํ ์์ ์ฌํญ์ brew๋ฅผ ํตํด vim์ ์ค์นํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ํ์ด์ฌ ๋ฒ์ ์ ๊ฒฝ์ฐ์๋ ์์ ๊ฒ์ํ์ง๋ง + python3์ด + python / dyn์ด ์๋, ๋ด ์ฌ๊ณผ๊ฐ ์ ๊ณต ํ vim์ด ๊ฐ์ง ๊ฒ๊ณผ ์ ํํ ์ผ์นํ๋์ง ํ์ธํด์ผํฉ๋๋ค!
@anirrudh ์ธ๋ถ ์ฌํญ์ ์์ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ๊ทธ๋ฆฌ๊ณ ์๋ํฉ๋๋ค.
๋๋ ๊ทธ ์ด์ ์ ํด๊ฒฐ์ฑ
์ ์ฐพ์๋ค.
ํ์ผ์ _reset_cache () ํจ์์์ CFUNCTYPE :
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py
๋ฉ๋ชจ๋ฆฌ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
๊ทธ๋ฐ ๋ค์์ด ํ์ผ๋ก ์ด๋ํ์ฌ ๋ค์ ์ฝ๋๋ฅผ ์ฐพ์์ต๋๋ค.
265 def _reset_cache():
266 _pointer_type_cache.clear()
267 _c_functype_cache.clear()
268 if _os.name in ("nt", "ce"):
269 _win_functype_cache.clear()
270 # _SimpleCData.c_wchar_p_from_param
271 POINTER(c_wchar).from_param = c_wchar_p.from_param
272 # _SimpleCData.c_char_p_from_param
273 POINTER(c_char).from_param = c_char_p.from_param
274 _pointer_type_cache[None] = c_void_p
275 # XXX for whatever reasons, creating the first instance of a callback
276 # function is needed for the unittests on Win64 to succeed. This MAY
277 # be a compiler bug, since the problem occurs only when _ctypes is
278 # compiled with the MS SDK compiler. Or an uninitialized variable?
279 CFUNCTYPE(c_int)(lambda: None)
๋ณด์๋ค์ํผ 279 ํ์ CFUNCTYPE ํจ์๋ ์ด๋ค ์ด์ ๋ก ๋ Win64์์ unittest์ ์ํด ์ถ๊ฐ๋ฉ๋๋ค. Mac ์ฌ์ฉ์์ ๊ฒฝ์ฐ์ด ์ค์ ์ธ๋ชจ๊ฐ ์์ผ๋ฉฐ macOS์์ ๋ฉ๋ชจ๋ฆฌ ์ค๋ฅ๋ก ์ด์ด์ง๋๋ค. ๊ทธ๋์ 279 ํ์ ์ฃผ์ ์ฒ๋ฆฌํ๊ณ vim์ ๋ค์ ์คํํ๋ฉด ์ ๋ ฅ์ ์ ์ค๋ฅ๊ฐ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์:
__init__.py
ํ์ผ์ ์์คํ
์ฝ๊ธฐ ์ ์ฉ ํ์ผ์ด๋ฉฐ, ์์คํ
๋ฌด๊ฒฐ์ฑ ๋ณดํธ๋ฅผ ๋นํ์ฑํํ๋ ค๋ฉด Mac ๋ณต๊ตฌ ๋ชจ๋์์ csrutil disable
๋ช
๋ น (๋ถํ
์ command + R ๋๋ฅด๊ธฐ)์ ์คํํด์ผํฉ๋๋ค. ์ฌ๋ถํ
ํ ๋ฃจํธ ๊ถํ์ ์ฌ์ฉํ์ฌ์ด ํ์ผ์ ํธ์ง ํ ์ ์์ต๋๋ค.
brew install vim --with-lua --with-override-system-vi
์
ธ์ ๋ค์ ์์ํ๊ณ ์์ ํ์ต๋๋ค.
https://github.com/Valloric/YouCompleteMe/issues/3165#issuecomment -425616700
๊ฐ์ฌํฉ๋๋ค @ Joshua-Chang
๊ทธ๊ฒ์ ๋๋ฅผ ์ํด ์ผํ์ต๋๋ค
๊ฐ์ฌํฉ๋๋ค @ Joshua-Chang
vim์ ๊ด์ฐฎ์ง ๋ง vi๋ ์ฌ์ ํ ์๋ชป๋์์ต๋๋ค.
`Vim : ์น๋ช
์ ์ธ ์ ํธ SEGV ํฌ์ฐฉ
๊ธฐ๋ฅ ์ฒ๋ฆฌ ์ค ์ค๋ฅ ๊ฐ์ง
4 ํ :
์์ธ MemoryError : MemoryError ()
๋ถํ ์ค๋ฅ : 11`
vim์ ๊ด์ฐฎ์ง ๋ง vi๋ ์ฌ์ ํ ์๋ชป๋์์ต๋๋ค.
์๋ง๋ ๋ ๋์ ํด์๋๊ฐ ์์ง๋ง alias vi="vim"
๋ฅผ ๋ด ์ rc ํ์ผ์ ์ถ๊ฐํ์ฌ ์์ ํ์ต๋๋ค.
commad git commit --amend
์ฌ์ฉํ ๋ @ whenever77 ๊ณผ ๋์ผํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
์๋ ํ์ธ์.
@ Joshua-Chang์ ์ ์์ ์๋ํด๋ณด์ญ์์ค.
@ Joshua-Chang์ ์ ์์ ์๋ํด๋ณด์ญ์์ค.
๋๋ ์๋ํ๋ค.
vim์ ์ง์ ์ฌ์ฉํ ๋ ์๋ํ์ง๋ง git commit --amend
๋ช
๋ น์ ์คํํ๊ฑฐ๋ ๋ช
๋ น ์ค์์ ์ถฉ๋์ ์์ ํ๋ ค๊ณ ํ๋ฉด ์ฌ์ ํ ์๋ชป๋์์ต๋๋ค.
๋ง์ง๋ง์ผ๋ก์ด ๊ธฐ์ฌ๋ฅผ ์ฝ๊ณ ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค. ๊บ๋ ๋
https://ltaoo.github.io/2018/10/22/%E6%9B%B4%E6%96%B0%20macOS%20Mojave%20%E5%90%8E%20vim%20%E6%89%93 % E4 % B8 % 8D % E5 % BC % 80 /
@kyriejoshua ํด๊ฒฐ์ฑ ์ ๊ณต์ ํ๋ ๋ง์?
๋ด ํด๊ฒฐ์ฑ ์ ๋๋ค. ํํ
cd ~/.vim/bundle/YouCompleteMe
git pull
git submodule update --init --recursive.
python install.py
์ ธ์ ๋ค์ ์์ํ๊ณ ์์ ํ์ต๋๋ค.
YCM ์ฌ์ฉ์์ ๊ฒฝ์ฐ YCM ์ฐ๋ฝ์ฒ ๋ฅผ ์ฌ์ฉํ์ธ์.
์์คํ Vim๊ณผ ์ ์ฌํ ๋ฌธ์ ๋ฅผ ์ฌ๊ธฐ์์ ์ถ์ ํ๊ณ ์์ต๋๋ค : https://github.com/Valloric/YouCompleteMe/issues/3271
์คํฌ์ผ๋ฌ ๊ฒฝ๊ณ : YCM์ด ์๋ Mojave ์ ํ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
๋์๊ฒ์ด ๋ฌธ์ ๋ Mojave๊ฐ "์ค์ํ ์
๋ฐ์ดํธ"๋ฅผ ์ค์น ํ ํ์ ๋ํ๋๊ธฐ ์์ํ์ต๋๋ค (์ : Vim / powerline์ด ์ ์๋ํ๋ ์ค๋ซ๋์ Mojave๋ฅผ ์ฌ์ฉํ์ต๋๋ค). /usr/bin/vim
์ ๋ด vim์ด ์๋๋ผ ์๋ชป๋ vim
์ฌ์ฉ (์ : /usr/bin/vim
, Apple์ ๋ด์ฅ vim) ํ ๊ฒฝ์ฐ /usr/local/bin/vim
. ๋ด PATH
๊ณ ์น๋ ๊ฒฝ์ฐ ์ผ๋ฟ์
๋๋ค. ์
๋ฐ์ดํธ๋ ์๋ง๋ ๊ทธ๊ฒ์ ์ฌ์ ๋ ฌํ์ต๋๋ค.
๋ฐฉ๊ธ Mojave๋ฅผ ์๋ก ์ค์นํ์ฌ Mac์ ์ฌ์ฉํ๊ธฐ ์์ํ๊ณ ์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. python3.7์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
๋ค์์ ์ํํ์ฌ ํด๊ฒฐํ์ต๋๋ค.
brew install vim
echo "alias vim=/usr/local/Cellar/vim/<VIM_VERSION>/bin/vim" >> ~/.bash_profile
VIM_VERSION์ brew๊ฐ ์ฒซ ๋ฒ์งธ ์ค์ ์ค์น๋ vim ๋ฒ์ ์ผ๋ก ๋ฐ๊พธ์ญ์์ค.
macOS Mojave ์ ๋ฐ์ดํธ์ ๊ด๋ จ์ด ์๋ค๋ ๋ ๋ค๋ฅธ ํ์ธ์ ์ถ๊ฐ ํ ์ ์์ต๋๋ค. ์ด๋ค ์์คํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ๋ณ๊ฒฝ๋์๋์ง ํ์ธํ๊ธฐ ์ํด ์์ง ์ ๋ฐ์ดํธ๋์ง ์์ ๋ค๋ฅธ ์์คํ ๊ณผ ๋น๊ต ์์ ์ ์ํํด์ผํฉ๋๋ค. ๊ธฐ๋ณธ python 2.7 (.10) ์ค์น์์ ๋ณ๊ฒฝ๋ ๋ด์ฉ์ด๊ฑฐ๋ ๊ด๋ จ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ์๋ ๋ด์ฉ์ด๋ผ๊ณ ํ์ ํฉ๋๋ค.
bash์์ zsh๋ก์ด ๊ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ฉด PATH
๋ด๋ณด๋ด๊ธฐ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค. export PATH=$HOME/bin:/usr/local/bin:$PATH
๋๋ ์ด๋ฏธ python 3.7.3, vim ([email protected]์ ์ํด ์ปดํ์ผ ๋ macvim์์ ํฌํจ ๋ ๋ฒ์ )์ ๊ฐ์ง๊ณ ์์๊ณ , ์ด๋ฏธ Mojave๋ฅผ ๊ฐ์ง๊ณ ์์์ต๋๋ค. zsh๋ก๋ง ์ ํํ์ต๋๋ค.
๊ทธ๋์ ์ ๋ ์
๋ฌด์ฉ ๋
ธํธ๋ถ์ Mojave๋ก ์
๊ทธ๋ ์ด๋ํด์ผํ๋ ๋ค์ ๋ ์ ์ด๊ฒ์ด ์ ์๊ฒ ํจ๊ณผ๊ฐ ์๋์ง ์์ ๋ด๋ ค๊ณ ๋ฒฝ์ ๋จธ๋ฆฌ๋ฅผ ๋ถ๋ช ํ๊ณ ์์ต๋๋ค. ์์ ๊ฐ์ด๋๋ฅผ ๋ฐ๋๊ณ ๋ค์ vim์์ powerline์ด ์๋ํ๊ฒ๋์์ง๋ง, ์ ์ถ์ ์ํด git commit
ํ๋ ค๊ณ ํ๋ฉด ์ ๋๋ก ์๋ํ์ง ์์ต๋๋ค.
๋๋ ๋ ๋ฒ ๋ด ์ฒดํฌ .zshrc
๋ด๊ฐ ํ ๋ด ํธ์ง๊ธฐ ์ธํธ ์๋ค๊ณ vim
. ๊ทธ๋ฐ ๋ค์ alias vi=vim
์ด๊ณ ์ฌ์ ํ ์ฃผ์ฌ์๊ฐ ์์ต๋๋ค.
๊ทธ๋ฐ ๋ค์ powerline๊ณผ vim์ ์ฝ ๋ฐฑ ๋ฒ ๋ค์ ์ค์น ํ ํ ์ค๋ฅ ๋ฉ์์ง์์ ๋ฐ๊ฒฌํ์ต๋๋ค (์ด๋ ํฐ๋ฏธ๋ ์ฐฝ์ ๋ค์ ์์ํ๊ณ tmux ๋๋ ๋ค๋ฅธ ๊ฒ์ ์์ํ์ง ์์ ํ ํจ์ฌ ์์ ์ค๋ฅ ๋ฉ์์ง์ ๋๋ค.
Vim: Caught deadly signal SEGV
Vim: Finished.
error: /usr/bin/vim died of signal 11
error: There was a problem with the editor '/usr/bin/vim'.
Please supply the message using either -m or -F option.
๋ฐ๋ก ๊ฑฐ๊ธฐ : /usr/bin/vim
๊ทธ๋์ ๋๋ ๋ ๋ฒ ํ์ธํ๊ณ .gitconfig
์์ ๋ค์๊ณผ ๊ฐ์ ์ค์ ๋ณด์์ต๋๋ค.
[core]
editor = /usr/bin/vim
editor = vim
๋ณ๊ฒฝ๋์์ต๋๋ค.
์์ฝ : git commit
vim ์ค์น์ ์ฌ์ ํ ๋ฌธ์ ๊ฐ์๋ ๊ฒฝ์ฐ .gitconfig
๊ฐ ์์คํ
vim์ ๊ฐ๋ฆฌํค๊ณ ์์ง ์์์ง ๋ค์ ํ์ธํ์ญ์์ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
ํด๊ฒฐ์ฑ !!
1) ํ์ฌ vim ๋ฒ์ ์ ํ์ ํ์ญ์์ค. Mine์ homebrew๋ก ์ปดํ์ผ๋์ง๋ ์์์ง๋ง Apple์ด Mojave ๋ฆด๋ฆฌ์ค๋ฅผ ์ํด ์ฌ ์ปดํ์ผ ํ ๊ธฐ๋ณธ ์์คํ ๋ฒ์ ์ด์์ต๋๋ค (๋ ์ง๋ณด๊ธฐ). ์ปดํ์ผ ๋ ์ง๋ฅผ ๊ธฐ์ค์ผ๋ก ์ฌ์ ์ง์ ์ด ์ ํํ๋ค๊ณ ์๊ฐํ์ง๋ง ํ๋ฆฌ๋ฉด ์์ ํ์ญ์์ค.
vim --version
์คํํ๋ฉด[email protected]
์ํด ์ปดํ์ผ๋์์์ ํ์ธํ ์ ์์ต๋๋ค.2) brew'd ๋ฒ์ ์ python @ 2 ๋ฅผ ์ ๊ฑฐํ๊ณ brew๋ฅผ ํตํด ํ์ด์ฌ์ ์ค์นํ์ต๋๋ค (์์ฑ ๋น์ ๊ธฐ๋ณธ์ ์ผ๋ก 3.7.0์ ์ค์น ํจ). ๊ทธ๋ฅ ๋๋์ด์ ์ค์น๋์ง ์์ผ๋ฉด brew python์ผ๋ก ์ปดํ์ผ๋์ง ์๋๋ค๋ ํฌ๋ผ์ ์ฝ์ด๋ณด์ญ์์ค. @ ZyX-I ์ด์ฉ๋ฉด ๋น์ ์ด ์ด๊ฒ์ ๋ํด ๋ ์๊ณ ์์ต๋๊น?
3)
brew install python
ํ homebrew๋ฅผ ์ฌ์ฉํ์ฌbrew install vim
๋ช ๋ น์ ์ฌ์ฉํ์ฌ vim์ ์ค์นํฉ๋๋ค. ๊ทธ๋ฐ ๋ค์/usr/local/bin/vim --version
์คํํ๊ณ python3 ์์ '+'๊ธฐํธ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค. ์ ธ์ ๋ค์ ์์ํ๋ฉด /.vimrc๊ฐ/Library/Python/2.7/site-packages/powerline/powerline/bindings/vim/
๋๋ ์ฐพ๊ณ ์๋ ๋๋ ํ ๋ฆฌ๋ฅผ ์ฝ์ด์ผํฉ๋๋ค..... ์๋ํด์ผํฉ๋๋ค!
ํธ์ง : ์ผ๋ถ ๋ฌธ๋ฒ, ์ปคํผ์์ด ์ผ์ต๋๋ค.