ChrisTitusTech / powershell-profile

Pretty PowerShell that looks good and functions almost as good as Linux terminal
551 stars 320 forks source link

vim editor config #4

Closed rajorshi-mandal closed 1 year ago

rajorshi-mandal commented 1 year ago

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 commented 1 year ago

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 ?

TheyCallMeZ commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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.

bertman80 commented 1 year ago

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"

itsRealGray commented 1 year ago

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

ChrisTitusTech commented 1 year ago

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