Breakpoint shortcut key in Vim Python-mode not updating - vim

I installed Python-mode as a plugin in my .vimrc:
Plugin 'klen/python-mode'
It got installed fine, but I had the breakpoint set to my <leader>b like this:
" Enable breakpoints plugin
let g:pymode_breakpoint = 1
let g:pymode_breakpoint_key = '<leader>b'
I then wanted to change the '<leader>b' to '<leader>k', but when I make the change, I still get the breakpoint when I hit leader-b and nothing when I do leader-k.
I've tried running PluginInstall, restarting Vim, and restarting my terminal. How do I get Vim to recognize this change to the .vimrc?

That's because g:pymode_breakpoint_key is not the name of the option. According to the pymode docs, the option is g:pymode_breakpoint_bind. So the below should work:
let g:pymode_breakpoint_bind = '<leader>k'

Related

how to restore the original size after using the NERDTree Menu in Vim?

I use NERDTree as a file explorer and after using its Menu, Vim does not return to its original size, see screenshots below.
Using NERDTree Menu:
After using the Menu:
The editor returns to normal only if I resize the terminal window.
My system config
Vim-GTK3 9.0
Terminal: Konsole
Debian 11
NERDTree Config
nmap <Leader>nt :NERDTreeFind<CR>
let NERDTreeQuitOnOpen=1
let NERDTreeShowHidden=1
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
let g:NERDTreeIgnore = ['^node_modules$']
I have a same issue and I have remove vim v9 and install from source last v8 and it's work!
I don't know what is happen in 9 version vim with the bottom pane, but I have observe that vim v8 on my remote server have a perfect working.
UPD:
And I founded issue on the NERDTree repo with the issue:
https://github.com/preservim/nerdtree/issues/1321
You can set cmdheight to 2 to solve the problem.
Add the following line into your .vimrc
set cmdheight=2
This is caused by an incompatibility between NERDTree and Vim 9.0.
You can fix it by applying this hotfix to your local copy of NERDTree.
Some alternatives:
Add let g:NERDTreeMinimalMenu=1 to your .vimrc to set menu to display in a single line
Use a version of Vim earlier than the 9.0 release
See issue #1321 in the NERDTree repo for more info.
This problem remains relevant. To restore the window size, you can try these shortcuts:
Ctrl+w _
Ctrl+w |
Ctrl+w =
Source: https://vim.fandom.com/wiki/Resize_splits_more_quickly

How to override vim plugin ctrl-p bindinds

I was using a vim config : https://github.com/astrails/dotvim
In this config I was able to bind ctrl+p to nerdtree and I got used to it. Now I'm trying to build my own vim config and even though I bind nerdtree to ctrl-p in my vim config using nmap <leader>p :NERDTreeFind<CR>, it's being overridden by the plugin Ctrl-P.
How can I get vim to use my binding and not the ctrlp one?
I know it's possible because somewhere in the package I was using it was done, but I can't figure out where. Any help would be most appreciated.
let g:ctrlp_map = '<c-p>'
Change as needed (this is the default). You can see all the configuration variables by typing :help ctrlp<CR>.

vim-go autocompletion not working

I recently installed vim-go using pathogen, but the autocompletion feature is not working. If I am using it only shows commands I've already used.
My .vimrc has
filetype plugin on
" Enable autocompletion
set omnifunc=syntaxcomplete#Complete
" Select keyword as you type
:set completeopt=longest,menuone
Do I need more than just this plugin? The other feature I have tested so far are working (:GoRun, syntax highlighting).
This is on a Ubuntu machine.
Are you typing C-X C-O to open the autocompletation window? This works fine for me.
On the other hand, if you want to get real-time completion (completion by type) install the following plugins YCM or neocomplete
The syntaxcomplete#Complete ships with Vim, not the Go filetype plugin, and it has very limited capabilities (basically, just offering the language's keywords). No wonder you're disappointed.
The ftplugin/go.vim file sets the correct, custom completion of the vim-go plugin:
setlocal omnifunc=go#complete#Complete
So, just ensure that the 'filetype' setting is correct (go), and that you don't have any additional configuration that overrides the plugin's.
:verbose setlocal omnifunc?
can tell you.
If none of these suggestions solves your problem, try killing gocode from a terminal:
gocode exit (or killall gocode it that fails)
gocode -s -debug
In case of startup failure due to a lingering unix socket, simply remove it and try again. Once everything is working, you can terminate the debug enabled gocode process (the plugin will autostart as needed)
This is what worked for me. default gocode pkg seems to be no longer maitained. so update it with the one below.
my go and vim versions:
VIM - Vi IMproved 8.2
go version go1.16.4
follow the steps below:
gocode exit
go get -u github.com/mdempsky/gocode
run gocode in debug mode
gocode -s -debug
try the autocomplete.(vim-go C+X C+O)
viola! you should see the list like so:

Missing NERDTree Commands

I am relatively new to vim and have an issue with NERDTree that I can't seem to figure out.
I seem to be missing a whole bunch of commands so when I map them to keys, I get the message (for example)
Not an editor command: NERDTreeMapToggleBookmarks
If I run :command I can see all the NERDTree global commands in there (those in section 2.1 of the docs) and these all seem to work but that's it.
I am using NERDTree 4.1.0 which I downloaded fresh from the github repo.
I suspect I may have either missed a step when setting up the plugin or am missing something in my .vimrc but I am at a bit of a loss.
Anyone have any pointers? Like I say, I am new to vim so it could be something really stupid or obvious!! ;)
Many thanks
I had the same issue after updating Vundle to the new interface.
Make sure you have
call vundle#begin()
and
call vundle#end()
wrapping your Plugin calls.
I recently ran into errors like Not an editor command: NERDTree*. What broke it for me was changing the line call vundle#rc() in my vimrc to call vundle#begin() because that's what I saw being used in the Vundle README. Switching back fixed the issue.
I am using this plugin for a long time. I have checked it and there is only one file in my ./plugins directory and 2 lines in my .vimrc configuration.
put NERD_tree.vim into .vim/plugins/ directory
add settings to your .vimrc config file:
" NERDTree configuration
let NERDTreeWinSize=35
" map to toggle NERDTree window
nmap :NERDTreeToggle
And that is all.

Macvim and rails.vim on rails 3 rc - Uninitialized constant Bundler (NameError)

Configured vim and gvim on Windows, as well as vim and macvim on OSX. Intend to learn rails 3, so installed rails 3 rc on both OS'ses. So far, so good.
When using macvim, each and every script execution offered by rails.vim gives me errors "Uninitialized constant Bundler (NameError)". Tried :Rserver, :Rgenerate, .... However, staying on OSX, when firing up vim from a terminal window, rails.vim runs just fine, as well as execution of the rails script from the terminal directly.
So somewhere, somehow my macvim configuration seems to mess things up. However, unless I'm mistaken, it simply uses the settings from the .vimrc and .gvimrc files. Now, the .gvimrc is really minimalistic, so I might just as well add it here:
set guifont=Inconsolata:h17 " Font family and font size.
set antialias " MacVim: smooth fonts.
set encoding=utf-8 " Use UTF-8 everywhere.
set guioptions-=T " Hide toolbar.
" set background=light " Background.
set lines=40 columns=100 " Window dimensions.
set guioptions-=r " Don't show right scrollbar
Any suggestion on how to solve this would be appreciated.
Your $PATH may not be set correctly in MacVim, or perhaps something else is missing from your environment?
Try starting a shell from MacVim using :shell and run the ruby commands manually to see if you get the same error. You could also try comparing environment variables between MacVim and Terminal vim using :new | read !env in each.
Version 7.3 of Vim was released yesterday. Checked, and a new version of MacVim was already built, based on this latest Vim release. Downloaded and tested, and rails.vim scripts work the way they are supposed to now! So issue solved.

Resources