powershell-profile icon indicating copy to clipboard operation
powershell-profile copied to clipboard

vim editor config

Open rajorshi-mandal opened this issue 2 years ago • 5 comments

i am not sure if its only with my system but when i typed "vim" i am getting the following error Screenshot (1834)

rajorshi-mandal avatar Oct 31 '22 15:10 rajorshi-mandal

i am not sure if its only with my system but when i typed "vim" i am getting the following error Screenshot (1834)

its working in normal powershell but launching it with windows terminal doesn't seem to work does they have different commands for execution ?

rajorshi-mandal avatar Oct 31 '22 15:10 rajorshi-mandal

In this block of Chris's Script he is checking to see what is installed on your system to determine which editor to use. if (Test-CommandExists nvim) { $EDITOR='nvim' } elseif (Test-CommandExists pvim) { $EDITOR='pvim' } elseif (Test-CommandExists vim) { $EDITOR='vim' } elseif (Test-CommandExists vi) { $EDITOR='vi' } Set-Alias -Name vim -Value $EDITOR

The options are Neovim https://github.com/neovim/neovim/wiki/Installing-Neovim

(I can only assume pvim is parasitic vim, and it uses the nimble library) https://github.com/paranim/pvim

vim https://www.vim.org/download.php -or- winget install vim.vim

vi (I think you need to install cygwin to get this?)

So I think the best options would be to get neovim or vim installed.

TheyCallMeZ avatar Nov 01 '22 03:11 TheyCallMeZ

@rajorshi-mandal Additionally, you could add your own editors into the list that would launch as a shortcut when you type vim Please note for anything outside of code or notepad you would need to add those to your PATH.

    $EDITOR='nvim'
} elseif (Test-CommandExists pvim) {
    $EDITOR='pvim'
} elseif (Test-CommandExists vim) {
    $EDITOR='vim'
} elseif (Test-CommandExists vi) {
    $EDITOR='vi'
} elseif (Test-CommandExists code) {
    $EDITOR='code'
} elseif (Test-CommandExists notepad) {
    $EDITOR='notepad'
} elseif (Test-CommandExists notepad++) {
    $EDITOR='notepad++'
} elseif (Test-CommandExists sublime_text) {
    $EDITOR='sublime_text'
}
Set-Alias -Name vim -Value $EDITOR

TheyCallMeZ avatar Nov 01 '22 15:11 TheyCallMeZ

@rajorshi-mandal Did this resolve your issue? If Not Please share what error messages you are getting now.

The Alternative if you do not mind having a "vim" alias, is that you can remove or comment out that chunk of code or at minimum the Set-Alias Line.

TheyCallMeZ avatar Nov 02 '22 01:11 TheyCallMeZ

For all the EDITOR messages, just put this on line 133 just before the 'if (Test-CommandExists nvim) {' So the editor will be notepad if none of the other commands exist. $EDITOR="notepad.exe"

bertman80 avatar Nov 02 '22 11:11 bertman80

In this block of Chris's Script he is checking to see what is installed on your system to determine which editor to use. if (Test-CommandExists nvim) { $EDITOR='nvim' } elseif (Test-CommandExists pvim) { $EDITOR='pvim' } elseif (Test-CommandExists vim) { $EDITOR='vim' } elseif (Test-CommandExists vi) { $EDITOR='vi' } Set-Alias -Name vim -Value $EDITOR

The options are Neovim https://github.com/neovim/neovim/wiki/Installing-Neovim

(I can only assume pvim is parasitic vim, and it uses the nimble library) https://github.com/paranim/pvim

vim https://www.vim.org/download.php -or- winget install vim.vim

vi (I think you need to install cygwin to get this?)

So I think the best options would be to get neovim or vim installed.

Thanks @TheyCallMeZ i had same issue #19 and as you recomended 'neovim or vim' could resolve that problem and i did 'choco install neovim' and Wallah its worked!

heres the SS Annotation 2023-01-19 030346

itsRealGray avatar Jan 18 '23 21:01 itsRealGray

Took @TheyCallMeZ snippit to expand the editors to fix this issue in commit 7381f33

ChrisTitusTech avatar Jan 25 '23 16:01 ChrisTitusTech