본문 바로가기
Linux

[vim] plugins

by s_signal 2025. 5. 30.
반응형

Coc

Coc install

Plug 'neoclide/coc.nvim', {'branch': 'release'}

https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim

 

Install coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers. - neoclide/coc.nvim

github.com

 

Coc config

  • 다음 command 입력 하면 coc-setting.json 을 열어준다. 거기에 설정을 찾아서 넣자.
:CocConfig
{
  "coc.source.buffer.enable": true,
  "inlayHint.enable": false,
  "languageserver": {
    "pyright": {
      "enable": true,
      "command": "pyright",
      "args": ["--stdio"],
      "filetypes": ["python"],
      "initializationOptions": {},
      "settings": {
        "pyright": {}
      }
    }
  }
}

 

https://github.com/neoclide/coc.nvim/issues/4074

 

Add configuration options for inlay hints · Issue #4074 · neoclide/coc.nvim

Is your feature request related to a problem? Please describe. The new inlay hints feature is quite visually noisy and can easily push lines over 80 characters. At present the only way to disable i...

github.com

 

https://github.com/fannheyward/coc-rust-analyzer

 

GitHub - fannheyward/coc-rust-analyzer: rust-analyzer extension for coc.nvim

rust-analyzer extension for coc.nvim. Contribute to fannheyward/coc-rust-analyzer development by creating an account on GitHub.

github.com

 


Error Case

[coc.nvim] pyright client: couldn't create connection to server.

  • 정상적으로 설치는 됐는데, vim 시작 할 때 위와 같은 오류가 발생되는 경우가 있다.
  • vim 에서 다음 command를 사용하여 오류 내용을 확인 해보면
:CocInfo
  • 아래와 같은 오류를 찾을 수 있다.... 면..
[language-client-client] - Server languageserver.pyright initialization failed.
  • vim에서 아래 command로 설정 file을 열어 다음과 같이 수정 해주자.
    command 부분이 pyright 로 되어있는데, 이것을 pyright-langserver로 수정 해준다.
    뭔가 문제가 생겨 langserver 가 실행되지 않아 이를 명시해 주는 것.
:CocConfig
{
   "languageserver":{
      "pyright":{
         "command":"pyright-langserver",
         "args":[
            "--stdio"
         ],
         "filetypes":[
            "python"
         ]
      }
   }

NERDTree

Plug 'preservim/nerdtree'                                  
Plug 'ryanoasis/vim-devicons'                              
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'

 

  • Options
    • highlight plugin 을 설치 해야 색으로 구분이 되어 보기 좋으나 cursor 이동 속도가 느리다.
    • 이를 위해 설정이 필요하다.
" ==============================================                                                                         
" =[NERD Tree]=======================================                                                                    
set guifont=FiraCode\ Nerd\ Font\ Mono:s11 " Putty allow only Mono type font                                             
set lazyredraw " increse cursor moving speed                                                                             
let g:NERDTreeQuitOnOpen=1 " close window after opening file                                                             
let g:NERDTreeHighlightCursorline = 0                                                                                    
let g:NERDTreeWinPos="left"                                                                                              
" let g:NERDTreeDirArrowExpandable = '▸'                                                                                 
" let g:NERDTreeDirArrowCollapsible = '▾'                                                                                
let g:NERDTreeDirArrowExpandable = '-'                                                                                   
let g:NERDTreeDirArrowCollapsible = '|'                                                                                  
let g:NERDTreeShowDevIcons=1                                                                                             
" Show the folder icon                                                                                                   
let g:WebDevIconsUnicodeDecorateFolderNodes = 0                                                                          
" --- highlight-------                                                                                                   
" The speed problem: Turn on all functions for highlight plugin makes the                                                
" cursor slow. So ExactMatch and PatternMatch functions should be disabled                                               
" If you want use above two functions, It is recommended to use                                                          
" NERDTreeSyntaxEnabledExtensions.                                                                                       
let g:NERDTreeLimitedSyntax = 1                                                                                          
let g:NERDTreeFileExtensionHighlightFullName = 1 " set color for full file name                                          
" let g:NERDTreeExactMatchHighlightFullName = 1 " ExactMatch not used                                                    
" let g:NERDTreePatternMatchHighlightFullName = 1 " PatternMatch is not used                                             
let g:NERDTreeHighlightFolders = 1 " enables folder icon highlighting using exact match                                  
let g:NERDTreeHighlightFoldersFullName = 1 " highlights the folder name                                                  
" let g:NERDTreeSyntaxDisableDefaultExtensions = 1                                                                       
let g:NERDTreeSyntaxDisableDefaultExactMatches = 1 " ExactMatch is not used                                              
let g:NERDTreeSyntaxDisableDefaultPatternMatches = 1 " patternmatch is not used                                          
"" let g:NERDTreeSyntaxEnabledExtensions = ['text', 'json', 'html', 'sh', 'c', 'h', 'c++', 'cpp', 'php', 'rb', 'js', 'css
', 'html'] " enabled extensions with default colors                                                                      
" Start NERDTree when Vim is started without file arguments.                                                             
autocmd StdinReadPre * let s:std_in=1                                                                                    
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif                                              
" Start NERDTree when Vim is started without file arguments.                                                             
" autocmd StdinReadPre * let s:std_in=1                                                                                  
" autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif
set lazyredraw " slow down the update screen
let g:NERDTreeLimitedSyntax = 1
let g:NERDTreeFileExtensionHighlightFullName = 1 " set color for full file name

" let g:NERDTreeExactMatchHighlightFullName = 1 " ExactMatch not used

" let g:NERDTreePatternMatchHighlightFullName = 1 " PatternMatch is not used

" let g:NERDTreeSyntaxDisableDefaultExtensions = 1

let g:NERDTreeSyntaxDisableDefaultExactMatches = 1 " ExactMatch is not used

let g:NERDTreeSyntaxDisableDefaultPatternMatches = 1 " patternmatch is not used

Install Font

https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode/Regular/FiraCodeNerdFontMono-Regular.ttf

wget https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Regular/FiraCodeNerdFontMono-Regular.ttf

 

  • font 등록
    • ubuntu
      • 지정된 경로에 저장된 font를 scan 하여 등록한다.
      • font 를 추가한 folder 내에 font 개수가 맞지 않을 경우 font file 을 의심하자.
// 다음 위치에 download
./local/share/fonts/

fc-cache -vf
// /home/ssignal/.local/share/fonts: caching, new cache contents: 1 fonts, 0 dirs
  • window - putty
    • 1. Install font by d-click the font file in font, xxx.ttf
    • 2. Open putty
    • 3. Load session
    • 4. Change settiongs
      • Window > Appearance > Font = FiraCodeXXXX
      • Window > Appearance > Font Quality = ClearType
      • Window > Translation > Character Set = UTF > 8
    • 5. save the session and launch

 

반응형