book
  • README
  • cheatsheet
    • bash
      • builtin
      • syntactic sugar
      • cmd
      • havefun
    • text-processing
      • awk
      • sed
      • html
      • json
      • regex
      • unicode
    • osx
    • curl
    • tricky
    • widget
    • proxy
    • colors
    • math
    • media
    • ssl
      • keystore
      • verification
      • server
      • client
      • tricky
    • windows
      • powershell
      • choco
      • wsl
      • wt
      • shortcut
      • clsid
      • env
      • shell:folder
  • vim
    • nvim
    • install
    • color
    • plugins
      • usage
      • other plugins
      • deprecated
    • tricky
    • viml
    • windows
    • troubleshooting
  • devops
    • admin tools
    • ssh
    • git
      • config
      • alias
      • submodule
      • eol
      • example
      • gerrit
        • gerrit API
      • github
      • troubleshooting
      • tricky
      • statistics
    • pre-commit
    • release-tools
    • tmux
      • cheatsheet
    • ansible
    • vault
    • artifactory
      • api
      • cli
      • aql
      • nginx cert
    • klocwork
      • kwadmin
      • kwserver
      • api
      • q&a
    • elk
    • mongodb
    • android
    • mobile
  • jenkins
    • config
      • windows
    • appearance
    • troubleshooting
    • jenkinsfile
      • utility
      • parallel
      • build
      • envvar
      • properties
      • trigger
      • node
    • script
      • job
      • build
      • stage
      • agent
      • security & authorization
      • exception
      • monitor
      • tricky
    • api
      • blueocean
    • cli
    • plugins
      • kubernetes
      • docker
      • shared-libs
      • lockable-resource
      • ansicolor
      • badge
      • groovy-postbuild
      • simple-theme
      • customizable-header
      • artifactory
      • jira-steps
      • job-dsl
      • build-timeline
      • crumbIssuer
      • coverage
      • uno-choice
      • tricky
  • virtualization
    • kubernetes
      • init
        • kubespray
        • kubeadm
          • environment
          • crio v1.30.4
          • docker v1.15.3
          • HA
        • addons
        • etcd
      • kubectl
        • pod
        • deploy
        • replicasets
        • namespace
        • secrets
      • node
      • certificates
      • events
      • kubeconfig
      • kubelet
      • troubleshooting
      • cheatsheet
      • auth
      • api
      • tools
        • monitor
        • helm
        • network
        • minikube
    • docker
      • run & exec
      • voume
      • remove
      • show info
      • dockerfile
      • dockerd
      • tricky
      • troubleshooting
      • windows
    • crio
    • podman
  • ai
    • prompt
  • osx
    • apps
      • init
      • brew
    • defaults
    • system
    • network
    • script
    • tricky
  • linux
    • devenv
    • util
      • time & date
      • output formatting
      • params
      • tricky
    • nutshell
    • disk
    • network
    • troubleshooting
    • system
      • apt/yum/snap
      • authorization
      • apps
      • x11
    • ubuntu
      • systemctl
      • x
    • rpi
  • programming
    • groovy
    • python
      • config
      • basic
      • list
      • pip
      • q&a
    • others
    • archive
      • angular
      • maven
      • mysql
        • installation
        • logs
      • ruby
        • rubyInstallationQ&A
  • tools
    • fonts
    • html & css
    • Jira & Confluence
    • node & npm
      • gitbook
      • hexo
      • github.page
      • code themes
    • app
      • microsoft office
      • vscode
      • virtualbox
      • iterm2
      • browser
      • skype
      • teamviewer
      • others
  • quotes
  • english
Powered by GitBook
On this page
  • startup scripts
  • chars
  • python
  • vimrc

Was this helpful?

  1. vim

troubleshooting

PreviouswindowsNextdevops

Last updated 1 month ago

Was this helpful?

[!TIP|label:references:]

startup scripts

[!TIP]

$ vim -V9logfile.log
$ vim --noplugin -D
:scriptnames

list all shortcut mapping

:verbose map
:map
:nmap
:vmap
:imap
  • :redir > ~/Desktop/debug.txt
    :silent verbose map
    :redir END
:set completefunc?
completefunc=youcompleteme#CompleteFunc

show terminal type

:TERM_PROGRAM
iTerm.app
  • $ defaults write org.vim.MacVim MMLoginShell 0

check buffer info

:echo getbufinfo()->filter({_,v -> v.terminal})

chars

[!NOTE|label:references:]

listchars shows ▯ ( unknown character )

[!NOTE|label:show printable non-ASCII characters:] reference:

  • reason

    • guifont doesn't support.

    • i.e.:

  • debug

python

[!NOTE|label:referenes:]

  • python arch version should be exact same with gvim arch version

    • python x64 <-> gvim x64

    • python x86 <-> gvim x86

  • label to check:

    • +python3/dyn

    • +python/dyn

  • debug

    • :echo has(python3)

    • :py3 print('hello')

    • :set pythonthreedll?

    • full commands:

      :echo has('python3')          " expected: 1
      :echo has('python3')
      :echo has('python3_dynamic')
      :echo has('python3_compiled')
      
      " others
      :echo has('python')
      :echo has('python_dynamic')
      :echo has('python_compiled')
      
      " or
      :python3 print('hello')       " expected: hello
      :py3 print('hello')           " expected: hello
  • specific settings

    set pythonthreedll=c:\path\to\python\python37.dll
    set pythonthreehome=c:\path\to\python

MatchTagAlways unavaiable: requries python

[!TIP]

  • the python issue might caused by 32bit vim not match with 64bit python, in this case, install macvim via

    # if necessary
    $ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    
    $ brew intall --HEAD macvim
    $ sudo ln -sf /opt/homebrew/Cellar/macvim/HEAD-45c5509/MacVim.app /Application/MacVim.app
  • issue

    $ vim
    MatchTagAlways unavaiable: requires python
    
    :py3 print('hello')
    the Python library could not be load
  • generic solution

    let g:python3_host_prog = '/path/to/python3'
    
    # in linux/osx
    let g:python3_host_prog = expand(trim( system('comamnd -v python3') ))
  • environment

    • os: ubuntu 22.04.3 LTS

    • python

      • installed from apt ppa sources

      • environment

        • /usr/local/bin/python3 -> /usr/local/bin/python -> /usr/bin/python3.12

        • /usr/local/bin/python3-config -> /usr/local/bin/python-config -> /usr/bin/python3.12

  • solution

    [!NOTE]

    $ sudo ldconfig
    # and re-build

vim: error while loading shared libraries: libpython3.11.so.1.0

  • issue

    $ vim
    vim: error while loading shared libraries: libpython3.11.so.1.0: cannot open shared object file: No such file or directory
  • env

    • os: CentOS 8.3

    • python: build from source, in /opt/python/Python3.11.6

  • solution

    $ export LD_LIBRARY_PATH=/opt/python/Python3.11.6:$LD_LIBRARY_PATH

E370: Could not load library "msys-python3.11.dll"

  • solution

    > cd c:\iMarslo\myprograms\Python3.11
    > cp python3.11.dll to msys-python3.11.dll
    
    # check $PATH contains `C:\iMarslo\myprograms\Python3.11`

windows app settings

[!NOTE|label:references:]

    • app location: %LocalAppData%\Microsoft\WindowsApps

  • solution

    • windows 10

      • Settings -> Apps -> Apps & features -> App Execution alias

      • disable both python.exe and python3.exe

    • windows 11

      • Settings -> Apps -> Advanced app settings -> App Execution alias

      • disable both python.exe and python3.exe

  • solution

    • delete both python.exe and python3.exe from %LocalAppData%\Microsoft\WindowsApps

    • setup environment variable for manual-installation ( %LocalAppData\Programs\Python\Python311 by default )

    > cd %LocalAppData%\Microsoft\WindowsApps
    > del python.exe
    > del python3.exe
    • > nuget.exe install python -ExcludeVersion -OutputDirectory .
      > nuget.exe install pythonx86 -ExcludeVersion -OutputDirectory .
  • [!NOTE]

    • Currently, the py.exe launcher cannot be used to start Python when it has been installed from the Microsoft Store.

vimrc

[!NOTE|label:references:]

verbose

[!NOTE|label:references:]

VALUE
COMMENTS

>= 1

When the viminfo file is read or written.

>= 2

When a file is ":source"'ed.

>= 5

Every searched tags file and include file.

>= 8

Files for which a group of autocommands is executed.

>= 9

Every executed autocommand.

>= 12

Every executed function.

>= 13

When an exception is thrown, caught, finished, or discarded.

>= 14

Anything pending in a ":finally" clause.

>= 15

Every executed Ex command (truncated at 200 characters).

:verbose set fileencodings?
  • general debugging with verbose

    set verbose=9
    # or
    set verbosefile=filename.txt
    
    " set verbose on startup
    vim -V9 file.text

echo

:echo has('multi_byte')
:echo has('multi_lang')

start time

[!NOTE|label:references:]

$ vim --startuptime vim.log

# compare with non-profile loaded
$ vim +q -u NONE -U NONE -N --startuptime startup-no-config.txt

# verify with specific ft
$ vim --startuptime python-startup.txt -c ":set ft=python" python-startup.txt

profile

[!NOTE|label:references:]

:profile start profile.log
:profile func *
:profile file *

{SLOW ACTIONS}

:profile pause
:qa!

messages

:messages
$ vim --cmd 'set t_RV='
:echo v:termresponse
# result :  ^[[>41;2500;0c
  • more:

    :help 'ttymouse'
    :help t_RV
    :help v:termresponse
if &term =~ '256color'
  " disable Background Color Erase (BCE)
  set t_ut=
endif
set ttyfast

<-> env.PYTHONHOME

* Vim help files
Troubleshooting
Debugging Vim
Debugging Vim by example
* iMarslo : run vim commands in terminal
* iMarlso : redirect cmd result into file
Time your Vim commands
* iMarslo : redirect cmd
Debug unexpected option settings
v9 logfile
step debug
list startup files
redirect all contents to a file
check customized completion
prevent MacVim from inheriting .profile as if it was Bash itself?
guifont
guifontset
guifontwide
VIM学习笔记 非可见字符(Listchars)
Comic Mono in Windows
:digraphs
:help feature-list
:help if_pyth
pythonthreedll
pythonthreehome
xcode-select: error: tool 'xcodebuild' requires Xcode
vim: Could not load library libpython
CMD opens Windows Store when I type 'python'
The Python executable is not recognized on Windows 10
Typing “python” on Windows 10 (version 1903) command prompt opens Microsoft store
3. Using Python on Windows
3.2. The Microsoft Store package
3.5. Alternative bundles
3.6. Configuring Python
PYTHONPATH
install via nuget.exe
know issues
3.8. Python Launcher for Windows
Unicode in vimrc no longer displaying correctly
why my option not working
Vim Verbose Map
why is vim slow to start up
How can I reduce startup time for vim?
slow-start
startup
why is "{ACTION}" slow
profiling
Vim has unexpected key presses on startup, what could be causing this?
Tmux is changing part of the background in vim
startup scripts
v9 logfile
step debug
list startup files
list all shortcut mapping
check customized completion
show terminal type
check buffer info
chars
listchars shows ▯ ( unknown character )
python
MatchTagAlways unavaiable: requries python
vim: error while loading shared libraries: libpython3.11.so.1.0
E370: Could not load library "msys-python3.11.dll"
windows app settings
vimrc
verbose
echo
start time
profile
messages
Vim has unexpected key presses on startup, what could be causing this?
Tmux is changing part of the background in vim
unknown character in listchars
Manage App Execution Aliases
Manage App Execution Aliases
verbose of set