megabyte-labs / install.doctor

A glorious combination of application / theme settings and a performant cross-platform, desktop-oriented software suite.
https://megabyte.space
Other
99 stars 22 forks source link

VIM / NVIM Need Love #69

Closed ProfessorManhattan closed 1 year ago

ProfessorManhattan commented 1 year ago

❔ What are you experiencing an issue with?

Latest Release

❔ Version

N/A

🐞 Description

I reorganized VIM and modified the vimrc file but they are now a bit out of wack. Both nvim and vim need some tweaking since they are spewing out a lot of errors. I'd like all the custom code to be stored in ~/.config/vim and ~/.config/nvim. We might have to just clone NvChad into ~/.config/nvim and then symlink our custom code from ~/.local/share/nvchad though. The plugins for VIM are now stored in ~/.local/share/vim.

To close this, tweak the NVIM and VIM settings so that no errors show up when editting various files with different extension types.

⏺️ Steps To Reproduce

No response

πŸ“’ Relevant Log Output

No response

πŸ’‘ Possible Solution

No response

ProfessorManhattan commented 1 year ago

Also, I took this out of the ~/.bashrc file:

### NVIM
VIM_NEOVIM_INTEGRATION='vim.cmd([[
set runtimepath^=~/.config/vim runtimepath+=~/.config/vim/after
let &packpath = &runtimepath
source ~/.vimrc
]])'
if command -v nvim > /dev/null && cat ~/.config/nvim/init.lua | grep 'set runtimepath^=~/.vim runtimepath+=~/.vim/after' > /dev/null; then
  ### Setup Neovim to work with Vim setup and plugins
  echo -e "$VIM_NEOVIM_INTEGRATION\n$(cat ~/.config/nvim/init.lua)" > ~/.config/nvim/init.lua || echo ''
  if -d ~/.var/app/io.neovim.nvim/config/nvim; then
    echo -e "$VIM_NEOVIM_INTEGRATION\n$(cat ~/.var/app/io.neovim.nvim/config/nvim/init.lua)" > ~/.var/app/io.neovim.nvim/config/nvim/init.lua || echo ''
  fi
fi
unset VIM_NEOVIM_INTEGRATION

Can you move the integration into the custom NVIM files located at ~/.local/share/nvchad

ProfessorManhattan commented 1 year ago

Hey @enggnr --- I ended up switching to AstroVim because it has a nice plugin system and is based off of NvChad.

For this ticket, please fix the VIM configuration so its stored in ~/.config/vim and base it off of this VIM configuration (the most starred on GH for VIM configs) https://github.com/amix/vimrc.

Use the advanced config and figure out how we can combine our current plugins into the setup.

enggnr commented 1 year ago

@ProfessorManhattan, there is no dot_vimrc file or dot_vim folder in the home folder. The vimrc file is now in dot_config/vim folder. This is where we want to store this file I understand.

It appears that -u is an argument that can be passed to vim and provide a custom location for vimrc file. We need to add an alias for this method to work. Another method I found was to create a ~/.vimrc with the content runtime vimrc and vim will look for the file in ~/.vim/vimrc (among other locations). If the idea is to keep the $HOME directory clean, then the first option may be the one to use.

The scripts in https://github.com/amix/vimrc are writing to ~/.vimrc.

Also, you switched to AstroNvim, right?

enggnr commented 1 year ago

@ProfessorManhattan, adding plugins to AstroNvim is not very complex. However, I was unable to determine if they were working or not, and any custom config necessary.

Given that there are AstroNvim equivalents for most of the plugins we install for Vim, do we need to configure them for Nvim as well? Looks like not all plugins work as is. For instance, fzf has a separate plugin for nvim - telescope-fzf-native. Adding the regular fzf plugin may not be desirable.