2

I'm running Gvim 704 on Windows 7 Ultimate x64. Sometimes for some unapparent reason I get these blue dot artifacts:

enter image description here

I'm very minimalist when it comes to plugins, I only use pathogen, ctrlp, nerdcommenter, tabular, vim-scroll-smooth and vim-surround. I also have a dll that enables me to go fullscreen via F11.

If I do any activity like changing windows (give focus to another window and refocus on vim again), close/reopen the vim buffer/window, toggle fullscreen etc the artifacts go away. It updates its position in the screen as I scroll up/down.

Here's my vimrc:

behave mswin
source $VIMRUNTIME/mswin.vim
let $PATH .= ';C:\Windows\SysWOW64'

""{{{ -- AutoCommands --

augroup FormatOptions
    autocmd!
    autocmd BufEnter * setlocal formatoptions-=cro
augroup END
    "Start maximized
    augroup OnEnter
        autocmd!
        autocmd VimEnter * call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
        autocmd GUIEnter * simalt ~x
    augroup END
    " Auto set working directory
    augroup UpdateCWD
        autocmd!
        autocmd BufEnter * silent! lcd %:p:h
    augroup END
""}}}

""{{{ -- Misc Settings --

    " split chars
    set fillchars=stl:-
    set fillchars+=vert:\|

    " fixes some scrolling/rendering issues
    set ttyscroll=0
    set nocursorline
    set nocursorcolumn

    " switch cases indentation
    set cinoptions==0

    " global search/replace by default
    set gdefault

    " cursor shape
    set guicursor+=i:ver11
    set guicursor+=v:ver11
    set guicursor+=n:block

    " disable blinking
    set guicursor=a:blinkon0

    " these four speed things up when syn high is enabled and browsing huge amount of text
    syntax sync minlines=256

    set norelativenumber
    set expandtab
    set nocompatible
    set shellslash
    set backspace=2
    set guifont=Courier_New:h12:cANSI
    "set guifont=Consolas:b:h12:cANSI "use _ for spaces
    color black
    syntax on
    set wrap
    set autoindent
    set smartindent
    set tabstop=4
    set shiftwidth=4
    set textwidth=65
    set laststatus=0                " status line
    filetype plugin indent on
    set noswapfile
    set nobackup
    set nohlsearch
    "set hlsearch                   " highlights all the found instances in a search
    set ignorecase                  " Ignore case when searching
    set smartcase                   " Ignore case if search is all lowercase, case-sensitive otherwise.
    set incsearch                   " Show search matches as you type.
    scriptencoding utf-8            " UTF-8 encoding
    set guioptions=                 " no gui, whatsoever
    set autoread                    " auto read files after they're modified without displaying a prompt
    set mouse=a

""}}}

""{{{ -- Plugins --

    " Fullscreen
    map <F11> <Esc>:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR>

    "Tabularize
    nnoremap <leader>t= :Tabularize /=<cr>
    nnoremap <leader>t{ :Tabularize /{<cr>
    nnoremap <leader>t: :Tabularize /:<cr>
    vnoremap <leader>t= :Tabularize /=<cr>
    vnoremap <leader>t{ :Tabularize /{<cr>
    vnoremap <leader>t: :Tabularize /:<cr>

    "CtrlP"
        let g:ctrlp_root_markers = ['Source', 'src']

        set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe,*.meta,*.mat,*.suo,*.csproj,*.sln,*.dwlt,
                        \*.asset,*.unity,*.db,*.xml,*.cache,*.prefab,*.fbx,*.max,*.lxo,*.blend,
                        \*.obj,*.3DS,*.smd,*.mp3,*.ogg,*.wav,*.png,*.jpg,*.prefs,*.anim,*.unityproj,
                        \*.config,*.log,*.rsp,
                        \*UnityTempFile*,*.pdb,*.dll,*.ilk,*.lnk,*.ini

        nnoremap <C-m><c-p> :CtrlPMRU<cr>

        let g:ctrlp_custom_ignore = {
          \ 'dir':  '\v[\/]\.(git|hg|svn)$',
          \ 'file': '\v\.(exe|so|dll|meta)$',
          \ 'link': 'some_bad_symbolic_links',
          \ }

    "UltiSnips"
        " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
        let g:UltiSnipsExpandTrigger="<s-tab>"
        let g:UltiSnipsJumpForwardTrigger="<c-k>"
        let g:UltiSnipsJumpBackwardTrigger="<c-i>"

        " If you want :UltiSnipsEdit to split your window.
        let g:UltiSnipsEditSplit="vertical"

    "Smooth scroll"
        noremap <silent> <c-f> m':call smooth_scroll#down(&scroll * 1, 1, 2)<CR>
        noremap <silent> <c-a> m':call smooth_scroll#up(&scroll * 1, 1, 2)<CR>

    "Pathogen"
        let g:pathogen_disabled = []
        execute pathogen#infect()
""}}}

""{{{ -- Mappings

    "collapse blocks of empty lines into a single one
    nnoremap <silent> <leader>re ma:%s/^\_s\+\n/\r<CR>'azz

    "unicode insertion
    inoremap <C-k> <C-v>
    cnoremap <C-k> <C-v>

    "member search (works only when lines start with member names)
    nnoremap <A-/> /^

    "indent block
    nnoremap + =}
    nnoremap =i =i{

    "find variable/function declaration (works when their name is the start of the line)
    nnoremap <A-d> yiw/^\<<C-R>"\><CR>zz
    "find struct/class/enum
    nnoremap <A-f><A-s> yiw/^\<struct <C-R>"\><CR>zz
    nnoremap <A-f><A-c> yiw/^\<class <C-R>"\><CR>zz
    nnoremap <A-f><A-e> yiw/^\<enum <C-R>"\><CR>zz

    "simple for loop template
    "inoremap ,for <C-O>m'for(; ;)<CR>{<CR>}<C-O>''<Esc>m'=i{''f(a

    "double toggle fullscreen
    nmap <leader>ff <F11><F11>

    "jump to end of file
    nnoremap <Space> G
    vnoremap <Space> G

    "serach for visually selected text
    vnoremap * y/<C-R>"<CR>
    vnoremap # y?<C-R>"<CR>

    "Jump list
    "forward
    nnoremap <S-o> <C-I>

    "Rename" (whole word)
    "current line
    nnoremap <A-r><A-r> :s/\<<c-r>=expand("<cword>")<cr>\>//I<left><left>
    "current function scope
    nmap <A-r><A-l> Y[mV%:s/\<<C-R>"\>//cI<left><left><left>
    "global
    nnoremap <A-r><A-g> :%s/\<<c-r>=expand("<cword>")<cr>\>//cI<left><left><left>

    nnoremap gr gd[{V%::s/<C-R>///cI<left><left><left>
    nnoremap gR gD:%s/<C-R>///cI<left><left><left>

    "Essential"
        " Leader
        let mapleader = ","
        " Quick vimrc edit
        nnoremap <leader>ev :vsplit $MYVIMRC <cr>
        " Quick vimrc reload (sourcing)
        nnoremap <leader>so :source $MYVIMRC <Bar>nohlsearch<cr>
        " Clear search
        nnoremap <silent><A-c> :nohlsearch<Return>
        inoremap <silent><A-c> <esc>:nohlsearch<Return>a
        " Quick insert/normal modes toggle (Caps is mapped to F2 via ahk)
        nnoremap <F2> i
        inoremap <silent><F2> <Esc>:call GoRightIfNotBOL()<CR>
        vnoremap <F2> <Esc>

    "Misc Nops
        nnoremap <A-f> <Nop>
        " mouse nops
        map <MiddleMouse> <Nop>

    "Movement"   
        noremap k gj
        noremap i gk
        noremap j h
        " Next/prev word (insert mode)
        inoremap <C-l> <esc>ea
        inoremap <C-j> <esc>bi
        " Jump to last cursor position
        nnoremap <A--> ``
        " Navigation
        "next/prev word/block
        nnoremap J b
        nnoremap L w
        "nnoremap I {
        "nnoremap K }
        vnoremap J b
        vnoremap L w
        "vnoremap I {
        "vnoremap K }   

        nnoremap / :set hlsearch<CR>:nohlsearch<CR>/
        nnoremap ? :set hlsearch<CR>:nohlsearch<CR>?

        nnoremap <silent> I :set nohlsearch<CR>?^\s*$<CR>:nohlsearch<CR>
        nnoremap <silent> K :set nohlsearch<CR>/^\s*$<CR>:nohlsearch<CR>
        vnoremap <silent> I ?^\s*$<CR>
        vnoremap <silent> K /^\s*$<CR>

        "next/prev method/function'
        nnoremap <silent>} /^{<CR>:nohlsearch<CR>
        nnoremap <silent>{ ?^{<CR>:nohlsearch<CR>

        "beginning/end of line
        nnoremap m ox<BS>
        nnoremap o Ox<BS>
        "nnoremap m o
        "nnoremap o O
        nnoremap h ^i
        nnoremap ' $a
        vnoremap h ^
        vnoremap ' $

        "jump to top/middle/bottom of the screen
        nnoremap <S-h> M
        nnoremap <S-t> H
        nnoremap <S-b> L
        vnoremap <S-h> M
        vnoremap <S-t> H
        vnoremap <S-b> L

        " jump to match
        nnoremap <S-m> %
        vnoremap <S-m> %

        "Scroll screen 'without' moving cursor
        "one char
        nnoremap <C-i> <C-y>
        nnoremap <C-k> <C-e>
        nnoremap <C-j> zh
        nnoremap <C-l> zl
        vnoremap <C-i> <C-y>
        vnoremap <C-k> <C-e>
        vnoremap <C-j> zh
        vnoremap <C-l> zl

        "screen
        nnoremap <C-h> zz
        nnoremap <C-t> zt
        nnoremap <C-b> zb
        vnoremap <C-h> zz
        vnoremap <C-t> zt
        vnoremap <C-b> zb

    "Clipboard"
        " Undoing
        nnoremap <C-z> u
        inoremap <C-z> <C-[>ui
        " This is due to the fact that in VS, Ctrl-V is reserved for paste
        nnoremap <A-v> <C-v>

    "Other"
        " yank current word
        nnoremap Y yiw

        " For recording purposes, fast repeating.
        nnoremap <A-2> @a

        " Change inside
        nnoremap <A-i> ci
        nnoremap <A-i><A-'> ci"
        nnoremap <A-i><A-9> ci(

        " Join
        nnoremap <A-j> J
        vnoremap <A-j> J

        " Visual->insert
        vnoremap <A-i> I
        vnoremap <A-a> A

        " Jumps cursor inside braces http://stackoverflow.com/questions/9621173/vim-and-indentation-with-brackets-braces
        inoremap {<CR> {<CR>}<C-o>O

    "Visual/Select"
        " Visually select the current word
        nnoremap v<space> viw

    "Numerics"
        " [de-in]crement
        nnoremap <A-a> <C-a>
        nnoremap <A-x> <C-x>

    "Deletion"
        " Delete word under cursor
        nnoremap d<space> diw
        nnoremap c<space> ciw
        " delete word to the left of cursor.
        inoremap <C-BS> <C-W>
        " Enhanced change line
        nnoremap <silent>cc :call ChangeCurrentLine()<cr>a

    "GUI"
        " Toggle menu bar
        nnoremap <silent><leader>tm :call ToggleMenuBar()<cr>

    "Buffers"
        " previous buffer
        nnoremap <leader>3 :buf #<CR>

        " Show a menu to complete buffer and file names
        set wildchar=<Tab> wildmenu wildmode=full"

        " Writing/saving
        inoremap <C-s> <C-[>:w <Enter>a
        nnoremap <C-s> :w <Enter>

        " To open a new empty buffer
        nnoremap <leader>T :enew<cr>

        " Move to the next buffer
        nnoremap <leader>l :bnext<CR>

        " Move to the previous buffer
        nnoremap <leader>j :bprevious<CR>

        " Close the current buffer and move to the previous one
        " This replicates the idea of closing a tab
        nnoremap <leader>bq :bp <BAR> bd #<CR>

        " Show all open buffers and their status
        nnoremap <leader>bl :ls<CR>

    "Windows"
        " Switching windows
        nnoremap <silent> <leader>wi :wincmd k<CR>
        nnoremap <silent> <leader>wk :wincmd j<CR>
        nnoremap <silent> <leader>wj :wincmd h<CR>
        nnoremap <silent> <leader>wl :wincmd l<CR>
        " Resizing
        nnoremap <silent><A-S-l> :15winc ><CR>
        nnoremap <silent><A-S-j> :15winc <<CR>
        nnoremap <silent><A-S-i> <C-w>5+
        nnoremap <silent><A-S-k> <C-w>5-
        " Veritcal Split
        nnoremap <leader>sv <C-w>v
""}}}

""{{{ -- Functions --
    function! ToggleMenuBar()
        let &g:guioptions = ToggleStringValue(&g:guioptions, "m")
    endfu

    function! IsLineEmpty(line)
        return match(a:line, '^\s*$') == -1 ? 0 : 1
    endfu

    function! IsCurrentLineEmpty()
        return IsLineEmpty(getline('.'))
    endfu

    function! ChangeCurrentLine()
        execute "normal! " . (IsCurrentLineEmpty() ? "0" : "^") . "C"
    endfu

    " Returns 1 if the cursor is at the beginning of a line "
    function! IsBOL()
        return col('.') == 1
    endfu

  function! GoRightIfNotBOL()
        if !IsBOL()
            execute "normal l"
        endif
    endfu

    function! ToggleStringValue(input, value)
        let l:result = a:input
        if l:result =~ a:value
            let l:result = substitute(l:result, a:value, "", "")
        else
            let l:result .= a:value
        endif
        return l:result
    endfu

    function! s:JumpMethod(char, flags, mode)
        let original_cursor = getpos('.')

        if a:mode == 'v'
            normal! gv
        elseif a:mode == 'o'
            normal! v
        endif

        while search(a:char, a:flags) > 0
            if a:char == '}'
                " jump to the opening one to analyze the definition
                normal! %
            endif

            let current_line = line('.')

            if getline(current_line) =~ '^\s*{'
                " it's alone on the line, check the above one
                let method_line = current_line - 1
            else
                let method_line = current_line
            endif

            let method_line_body = getline(method_line)

            if method_line_body =~ '\k\+\s*(.*)' && method_line_body !~ '\<\(for\|foreach\|if\|while\|switch\|using\|catch\|get\|set\)\>'
                " it's probably a function call

                if a:char == '}'
                    " we need to go back to the closing bracket
                    normal! %
                endif

                echo
                return
            else
                if a:char == '}'
                    " we still need to go back to the closing bracket
                    normal! %
                endif
            endif
        endwhile

        " if we're here, the search has failed, restore cursor position
        echo
        call setpos('.', original_cursor)
    endfunction
""}}}

I never had these issues before but I vaguely remember starting to have them around the time I added the ilnes:

set ttyscroll=0
set nocursorline
set nocursorcolumn

syntax sync minlines=256

I'm not exactly sure they're related but I do remember adding them was an attempt to solve the rendering/artifacts problems. The artifacts don't happen in a replicate-able manner so even if I were to disable those options I might not see any immediately but eventually do.

Does anyone have any idea what could be causing this and how to get rid of it?

  • can you try vi.stackexchange.com/a/2004/1821 and le us know if this issues is related to your vimrc ? – nobe4 Sep 3 '15 at 5:40
  • Does it happen with another font? One that has italic and bold also installed. – VanLaser Sep 3 '15 at 8:10
  • Well I commented out the lines I was suspicious about and used another font "Input Mono", earlier I was using "Courier_New". So far it's not happening, and scrolling is a bit faster BUT there is this common jitter/flicker that happens when I scroll via C-y/C-e (single line scroll) and not page up/down. – vexe Sep 3 '15 at 14:32
  • 1
    Yes, 7.4 with all the patches written from its release until now ... ftp.vim.org/pub/vim/patches/7.4/README – VanLaser Sep 4 '15 at 15:04
  • 1
    Yes. I recommend this one - the "Win 64bit" link. After extraction, remove the 'vimrc' and 'gvimrc' files from the main folder. Alternatively, there is bintray.com/veegee/generic/vim_x64 – VanLaser Sep 4 '15 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.