tsony-tsonev / nerdtree-git-plugin

A plugin of NERDTree showing git status
19 stars 0 forks source link

Many spaces #3

Closed dyrkow closed 5 years ago

dyrkow commented 5 years ago

Hi, cool fork, thanks :)

But I have this problem and I not understand how to solve it.

image

This is my .vimrc

...

let g:NERDTreeGitStatusWithFlags = 1
let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "⋆",
    \ "Staged"    : "•",
    \ "Untracked" : "∘",
    \ "Dirty"     : "⁖",
    \ "Clean"     : "✔︎",
    \ }

let g:WebDevIconsUnicodeDecorateFolderNodes = 0
let g:NERDTreeGitStatusNodeColorization = 1
let g:NERDTreeColorMapCustom = {
    \ "Modified"  : "#f8cc7a",
    \ "Staged"    : "#7fb777",
    \ "Untracked" : "#e2787b",
    \ "Dirty"     : "#299999",
    \ "Clean"     : "#87939A",
    \ "Ignored"   : "#808080"
    \ }

...
tsony-tsonev commented 5 years ago

Yep I had that to, it's web devicons related. You can add the following:

let g:WebDevIconsNerdTreeAfterGlyphPadding = ' '
let g:WebDevIconsNerdTreeBeforeGlyphPadding = ''
dyrkow commented 5 years ago

@tsony-tsonev Thanks for answer. I'm use

let g:WebDevIconsNerdTreeAfterGlyphPadding = ''
let g:WebDevIconsNerdTreeBeforeGlyphPadding = ''

And in result I have two spaces. But, when I open file and after some time (~5-10seconds) all fine :)

video: https://app.hyfy.io/v/abxM2Olbt3n/

tsony-tsonev commented 5 years ago

Hm... this is very strange. Have you tried setting the configuration at the top of your .vimrc ?

dyrkow commented 5 years ago

Nope, bottom

set nocompatible

if has('python3')
  silent! python3 1
endif

set shell=sh

"-------------------------"
"       DEPENDENCIES      "
"-------------------------"

call plug#begin('~/.vim/plugged')

" Interface
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ryanoasis/vim-devicons'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'hzchirs/vim-material'
Plug 'ap/vim-css-color', { 'for': ['css', 'scss', 'sass', 'stylus']}
Plug 'valloric/matchtagalways', { 'for': ['html', 'php'] }

" Git
Plug 'airblade/vim-gitgutter'
Plug 'junegunn/gv.vim'
Plug 'tpope/vim-fugitive'
Plug 'cohama/agit.vim'

" Commands
Plug 'tomtom/tcomment_vim'
Plug 'mattn/emmet-vim', { 'for': ['html','php'] }
Plug 'tpope/vim-surround'
Plug 'jiangmiao/auto-pairs'
Plug 'terryma/vim-multiple-cursors'
Plug 'jeetsukumaran/vim-buffergator'
Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
Plug 'majutsushi/tagbar', { 'for': ['javascript', 'php'] }
Plug 'wincent/ferret'
Plug 'ronakg/quickr-preview.vim'
Plug 'joegesualdo/jsdoc.vim', { 'for' : ['javascript'] }
Plug 'kien/ctrlp.vim'
Plug 'wellle/targets.vim'
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-repeat'
Plug 'SirVer/ultisnips', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'honza/vim-snippets', { 'for': ['javascript', 'javascript.jsx'] }

Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'tsony-tsonev/nerdtree-git-plugin'

" Syntax highlight
Plug 'sheerun/vim-polyglot'
"Plug 'mxw/vim-jsx', { 'for' : ['javascript', 'javascript.jsx'] }
Plug 'othree/yajs.vim', { 'for' : ['javascript', 'javascript.jsx'] } " ES6 ES7
Plug 'ianks/vim-tsx', { 'for' : ['typescript.tsx'] }

"Syntax support
Plug 'w0rp/ale'
Plug 'valloric/youcompleteme', { 'for' : ['javascript', 'javascript.jsx', 'typescript'] }
Plug 'ternjs/tern_for_vim', { 'for' : ['javascript', 'javascript.jsx', 'typescript'] }
Plug 'xolox/vim-misc'
Plug 'prettier/vim-prettier'

" Debug
Plug 'vim-vdebug/vdebug'

call plug#end()

"-------------------"
"   BASE SETTINGS   "
"-------------------"

let mapleader = "\<Space>"

syntax on

"Fix ^M
set ff=unix

set encoding=utf-8 

set guifont =Cousine\ Nerd\ Font\ Mono:h13

colorscheme vim-material

"Search highlight
set hlsearch

"Window width
set columns=200

"Highlight row width
set colorcolumn=100
highlight ColorColumn ctermbg=darkgray

"Visible count row on top and down
set scrolloff=15

"Hide cursor on insert mode
set mousehide

"Highlight current line
set cursorline

"Disable underline link
let html_no_rendering=1

"Status line show every time
set laststatus=2

"Show document info in status line
set ruler

"History command size
set history=500

"Tabs configuration
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent

"Show line number
set number

"Line space
set linespace=3

"Break word
set linebreak
set dy=lastline

"File symbols
set list
set listchars=tab:‣\ ,trail:•,precedes:«,extends:»

"Ignore search font size
set ic

"Human split
set splitbelow
set splitright

"Don't use swap files
set noswapfile
set nowritebackup
set nobackup
set nowb

"Hide menu bar
set guioptions-=m

"Hide tool bar
set guioptions-=T

"Spell language
setlocal spell spelllang=en_us

"-------------------------"
"       KEY BINDS         "
"-------------------------"

" :help keycodes

" Navigate between buffers
map <C-k> <C-w><Up>
map <C-j> <C-w><Down>
map <C-l> <C-w><Right>
map <C-h> <C-w><Left>

" NERDTree
map <C-t> :NERDTreeToggle<CR>

" FIGUTIVE
nmap <Leader>hr <Plug>GitGutterUndoHunk

" JS DOC
nnoremap <Leader>d :call JSDocAdd()<CR>

" TERN
nmap <Leader>g :TernDef<CR>
nmap <Leader>r :TernRename<CR>

nmap go <plug>(quickr_preview)
nmap gi <plug>(quickr_preview_qf_close)

" <Leader>f{char} to move to {char}
map  <Leader>c <Plug>(easymotion-bd-f)
nmap <Leader>c <Plug>(easymotion-overwin-f)

"s{char}{char} to move to {char}{char}
" nmap s <Plug>(easymotion-overwin-f2)

"Move to line
map <Leader>l <Plug>(easymotion-bd-jk)
nmap <Leader>l <Plug>(easymotion-overwin-line)

"Move to word
map  <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)

"TAG BAR
nmap <Leader>z :TagbarToggle<CR>

"--------------------"
"  PLUGIN SETTINGS   "
"--------------------"

" " AIR LINE
let g:airline_theme='material'

" JSx
let g:jsx_ext_required = 0
" let g:jsx_pragma_required = 1

" CTRLP
let g:ctrlp_custom_ignore = '\v[\/](node_modules|dist|build|vendor)|(\.(swp|ico|git|svn))$'
let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_map = '<Leader>f'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
let g:ctrlp_dotfiles = 0
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_root_markers = ['.ctrlp']

" NERDTree
let g:NERDTreeDirArrowExpandable = 'L'
let g:NERDTreeDirArrowCollapsible = 'L'
let g:airline_powerline_fonts = 1

" COMMENTARY
" gcc - toggle comment
" gc - toggle comment in visual mode

" ALE
" 1. Install eslint in project - npm i -D eslint prettier
" 2. npm i -D eslint-plugin-prettier eslint-config-prettier
" 3. lint and use standart option
" let g:ale_lint_on_text_changed = 'never' "check when save file
let g:ale_sign_column_always = 1
let g:ale_sign_error = '●'
let g:ale_sign_warning = '●'
let g:ale_statusline_format=['X %d', '? %d', '']
let g:ale_echo_msg_format = '%linter% says %s'
let g:ale_linters = {'javascript': ['eslint']}
let g:ale_fixers = {'javascript': ['prettier', 'eslint']}

" AUTO PAIRS
let g:AutoPairsShortcutFastWrap = '<C-e>'

" EMMET
let g:user_emmet_leader_key='<Tab>'

" GIT GUTTER
let g:gitgutter_sign_added = '+'
let g:gitgutter_sign_modified = '~'
let g:gitgutter_sign_removed = '-'
let g:gitgutter_sign_removed_first_line = '-'
let g:gitgutter_sign_modified_removed = '-'

autocmd BufWritePost * GitGutter

if executable('git')
  let g:gitgutter_hightlight_lines=1
else
  let g:gitgutter_git_executable='/bin/true'
  let g:gitgutter_enabled = 0
endif

" GIT VIEW
function! s:gv_expand()
  let line = getline('.')
  GV --name-status
  call search('\V'.line, 'c')
  normal! zz
endfunction
autocmd! FileType GV nnoremap <buffer> <silent> + :call <sid>gv_expand()<cr>

" FUGITIVE
set diffopt+=vertical

" YOU COMPLETE ME
let g:ycm_autoclose_preview_window_after_completion=0
let g:ycm_configrm_extra_conf=0
set completeopt-=preview
let g:ycm_semantic_triggers =  {
  \   'c' : ['->', '.'],
  \   'objc' : ['->', '.'],
  \   'ocaml' : ['.', '#'],
  \   'cpp,objcpp' : ['->', '.', '::'],
  \   'perl' : ['->'],
  \   'php' : ['->', '::'],
  \   'cs,java,javascript,d,python,perl6,scala,vb,elixir,go' : ['.'],
  \   'vim' : ['re![_a-zA-Z]+[_\w]*\.'],
  \   'ruby' : ['.', '::'],
  \   'lua' : ['.', ':'],
  \   'erlang' : [':'],
  \ }

" INDENT GUIDES LINES
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd  guibg='#32424a' ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg='#212c31' ctermbg=4

" BUFFERATOR
let g:buffergator_window_statusline = 1
let g:buffergator_sort_regime = "mru"
let g:buffergator_viewport_split_policy = "B"
let g:buffergator_split_size = 10
let g:buffergator_autoexpand_on_split = 0

" FERRET
" Ack <search>
" Ack /search/replace/
" autocmd BufWritePost *.js Prettier

"TERN
" Need  ~/.tern-config
" let g:tern_show_argument_hints='on_hold'
let g:tern_map_keys=1

"MULTIPLE CURSOR
" Cntrl + n

"quickr-preview
let g:quickr_preview_keymaps = 0

"NERDThee git indicators
let g:NERDTreeGitStatusWithFlags = 1
let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "⋆",
    \ "Staged"    : "•",
    \ "Untracked" : "∘",
    \ "Dirty"     : "⁖",
    \ "Clean"     : "✔︎",
    \ }

+let g:WebDevIconsNerdTreeAfterGlyphPadding = ''
+let g:WebDevIconsNerdTreeBeforeGlyphPadding = ''

let g:WebDevIconsUnicodeDecorateFolderNodes = 0
let g:NERDTreeGitStatusNodeColorization = 1
let g:NERDTreeColorMapCustom = {
    \ "Modified"  : "#f8cc7a",
    \ "Staged"    : "#7fb777",
    \ "Untracked" : "#e2787b",
    \ "Dirty"     : "#299999",
    \ "Clean"     : "#87939A",
    \ "Ignored"   : "#808080"
    \ }

"ULTISNIPS
let g:UltiSnipsExpandTrigger="<S-Enter>"
let g:UltiSnipsJumpForwardTrigger="<S-Enter>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
tsony-tsonev commented 5 years ago

Try moving the whole configuration and color mappings more to the top and see if the behavior changes.

tsony-tsonev commented 5 years ago

@WebWorkDeveloper what happened, did moving the colors and identation configuration to the top of your vimrc solved your problem. Either way I'll be soon closing this issue, because it does not seem to be a bug with the plugin, it is rather somewhere in your vimrc (because the configs are applied correctly, but after some seconds)

dyrkow commented 5 years ago

@tsony-tsonev moving the whole configuration and color mapping more to the top don't solve the problem, but you can close this issue)