remove old vim config

This commit is contained in:
Candifloss 2024-12-23 15:03:45 +05:30
parent 27d0b25f88
commit 42197eb023
2 changed files with 0 additions and 300 deletions

View File

@ -1,146 +0,0 @@
# System-wide `vimrc` Configuration with Vim-Plug
This guide outlines the steps to set up a system-wide configuration for `vim` and install plugins using the plugin manager [Vim-Plug](https://github.com/junegunn/vim-plug). For more details on using `vim-plug`, other plugin managers, or individual plugins, consult their respective documentation or browse [VimAwesome](https://vimawesome.com/).
---
### 1. Setting Up the Configuration Directories
First, ensure that the necessary directories for system-wide vim configuration exist.
```bash
# Create the main vim configuration directory if it doesn't exist
mkdir -p /etc/vim
cd /etc/vim
```
Next, create the required subdirectories with appropriate permissions:
```bash
# Create directories for autoload, colors, plugins, session data, etc.
mkdir -m 755 autoload colors plugged session sessions
```
---
### 2. Installing Vim-Plug and Color Schemes
#### 2.1. Download Vim-Plug
Vim-Plug is the plugin manager that will be used to install and manage plugins. Download it to the `autoload` directory:
```bash
curl -fLo /etc/vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
```
Set the appropriate permissions for the downloaded file:
```bash
chmod o+r /etc/vim/autoload/*
```
#### 2.2. Install a Color Scheme (Optional)
You can choose a color scheme of your choice. For this example, we'll use the **Molokai** color scheme.
```bash
curl -fLo /etc/vim/colors/molokai.vim https://raw.githubusercontent.com/tomasr/molokai/refs/heads/master/colors/molokai.vim
```
Ensure that the color scheme file has the correct permissions:
```bash
chmod o+r /etc/vim/colors/*
```
---
### 3. Configuring the `vimrc`
The system-wide `vimrc` file location might vary depending on your Linux distribution. On Ubuntu, it is typically found at `/etc/vim/vimrc`. If the file doesn't exist, create it.
```bash
touch /etc/vim/vimrc
chmod 755 /etc/vim/vimrc
vim /etc/vim/vimrc
```
#### 3.1. Set Runtime Paths
To ensure `vim` recognizes the autoload, plugin, and color scheme directories, add the following lines to your `vimrc`:
```vim
set runtimepath+=/etc/vim/autoload
set runtimepath+=/etc/vim/plugged
set runtimepath+=/etc/vim/colors
```
#### 3.2. Enable Vim-Plug and Install Plugins
To initialize `vim-plug` and install plugins, add the following configuration to your `vimrc`. This specifies the plugin directory and lists the plugins you'd like to use.
```vim
" Initialize Vim-Plug
call plug#begin('/etc/vim/plugged')
" List plugins here
Plug 'rust-lang/rust.vim' " Example plugin for Rust syntax highlighting
" Add more plugins as needed...
" End plugin section
call plug#end()
```
#### 3.3. Enable Filetype Plugins and Indentation
To enable filetype-specific plugins and proper indentation, add this line to your `vimrc`:
```vim
filetype plugin indent on " Enable filetype-based plugins and indentation
```
You can also add any other custom configurations such as tab size, line numbering, or key mappings. For a comprehensive example, refer to [my vimrc](https://git.candifloss.cc/candifloss/dotfiles/src/branch/main/vim/vimrc).
---
### 4. Installing the Plugins
Once you've updated your `vimrc`, its time to install the plugins.
#### 4.1. Source the `vimrc`
After saving the changes to the `vimrc`, source it to apply the changes:
```vim
:source %
```
#### 4.2. Install Plugins
Run the following command to install the plugins specified in your `vimrc`:
```vim
:PlugInstall
```
This will download and install all the listed plugins.
---
### 5. Enjoy Vim with Plugins
Once the installation is complete, your system-wide `vim` should be fully configured with the desired plugins and color schemes. You're now ready to enjoy a fully customized `vim` experience!
---
### Troubleshooting
- **Permissions**: Ensure that the directories and files in `/etc/vim` have the correct read and execute permissions for all users who need access.
- **Plugin Conflicts**: If you encounter issues with specific plugins, check their documentation for configuration options or known issues.
---
Enjoy your new and enhanced `vim` setup!
---

154
vim/vimrc
View File

@ -1,154 +0,0 @@
"" General
set runtimepath+=/etc/vim/autoload
set runtimepath+=/etc/vim/plugged
set runtimepath+=/etc/vim/session
set runtimepath+=/etc/vim/sessions
set runtimepath+=/etc/vim/colors
set nowrap " Wrap lines
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set hlsearch " Highlight all search results
set smartcase " Enable smart-case search
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
set autoindent " Auto-indent new lines
set shiftwidth=4 " Number of auto-indent spaces
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
"" Advanced
set ruler " Show row and column ruler information
call plug#begin('/etc/vim/plugged')
" c
Plug 'vim-scripts/c.vim', {'for': ['c', 'cpp']}
Plug 'ludwig/split-manpage.vim'
" html
"" HTML Bundle
Plug 'hail2u/vim-css3-syntax'
Plug 'gko/vim-coloresque'
Plug 'tpope/vim-haml'
Plug 'mattn/emmet-vim'
" javascript
"" Javascript Bundle
Plug 'jelera/vim-javascript-syntax'
" php
"" PHP Bundle
Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install --no-dev -o'}
Plug 'stephpy/vim-php-cs-fixer'
" python
"" Python Bundle
Plug 'davidhalter/jedi-vim'
Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
" ruby
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-projectionist'
Plug 'thoughtbot/vim-rspec'
Plug 'ecomba/vim-ruby-refactoring', {'tag': 'main'}
" rust
" Vim racer
Plug 'racer-rust/vim-racer'
" Rust.vim
Plug 'rust-lang/rust.vim'
" CSS
Plug 'hail2u/vim-css3-syntax'
Plug 'webfd/vim-scss'
" Bash
Plug 'vim-scripts/sh.vim'
" Plug 'zplugin/zplugin-vim-syntax'
" Vim lsp
Plug 'prabirshrestha/vim-lsp'
" Async.vim
" Plug 'prabirshrestha/async.vim'
" Asyncomplete.vim
" Plug 'prabirshrestha/asyncomplete.vim'
" Asyncomplete lsp.vim
" Plug 'prabirshrestha/asyncomplete-lsp.vim'
" Yuck
" Plug 'elkowar/yuck.vim'
" Airline statusbar
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"" Include user's extra bundle
" if filereadable(/home/ucadmin/.vim/.vimrc.local.bundles")
" source ~/.vimrc.local.bundles
" endif
call plug#end()
" END PLUGINS""""""""""""""""
" Required:
filetype plugin indent on
set backspace=indent,eol,start
colorscheme molokai
let g:airline_powerline_fonts = 1
let g:airline_theme='bubblegum'
" vim-airline
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
if !exists('g:airline_powerline_fonts')
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_left_sep = '▶'
let g:airline_left_alt_sep = '»'
let g:airline_right_sep = '◀'
let g:airline_right_alt_sep = '«'
let g:airline#extensions#branch#prefix = '⤴' "➔, ➥, ⎇
let g:airline#extensions#readonly#symbol = '⊘'
let g:airline#extensions#linecolumn#prefix = '¶'
let g:airline#extensions#paste#symbol = 'ρ'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
else
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = ''
" powerline symbols
let g:airline_symbols.space = " "
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = '  '
let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.colnr = '  '
endif