Installation and configuration of oh my bash and Vim editor.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
3.6 KiB

2 years ago
  1. # Oh My Bash and `.bashrc file`
  2. Next, to make easier work with the bash system let us install the oh-my-bash tool:
  3. ```
  4. $ bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
  5. ```
  6. - make an alias
  7. - export `export PATH="/home/username/anaconda/bin:$PATH"` or `PATH="/home/username/anaconda/bin:$PATH"`
  8. - `ln -s``
  9. # Install Vim Plugin manager
  10. First we need to install the Vim plugin manager to easily add and remove packages into vim editor. Thus, let us add the `plugin.vim`:
  11. ```
  12. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  13. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  14. ```
  15. ## Usage
  16. Add a vim-plug section to your `~/.vimrc` file:
  17. 1. Begin the section with call plug#begin([PLUGIN_DIR])
  18. 2. List the plugins with `Plug` commands
  19. 3. call `plug#end()` to update `&runtimepath` and initialize plugin system
  20. * Automatically executes `filetype plugin indent on and syntax enable`. You can revert the settings after the call. e.g. `filetype indent off`, `syntax off`, etc.
  21. ## Example
  22. ```
  23. call plug#begin()
  24. " The default plugin directory will be as follows:
  25. " - Vim (Linux/macOS): '~/.vim/plugged'
  26. " - Vim (Windows): '~/vimfiles/plugged'
  27. " - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
  28. " You can specify a custom plugin directory by passing it as the argument
  29. " - e.g. `call plug#begin('~/.vim/plugged')`
  30. " - Avoid using standard Vim directory names like 'plugin'
  31. " Make sure you use single quotes
  32. " Any valid git URL is allowed
  33. Plug 'https://github.com/junegunn/vim-github-dashboard.git'
  34. " On-demand loading
  35. Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
  36. " Initialize plugin system
  37. call plug#end()
  38. ```
  39. For a better understanding on how to use the Vim Plugin manager visit the [git webpage](https://github.com/junegunn/vim-plug).
  40. # The `.vimrc` file
  41. Next you will see the contents of the `vimrc` file in this repository:
  42. ```
  43. " ------------------
  44. " __
  45. " .--.--.|__|.--------.----.----.
  46. " | | || || | _| __|
  47. " \___/ |__||__|__|__|__| |____|
  48. " ------------------
  49. "
  50. " Basic settings
  51. " --------------
  52. set nocompatible
  53. filetype plugin indent on
  54. syntax enable
  55. set number relativenumber
  56. set path+=**
  57. set wildmode=longest,list,full
  58. set encoding=UTF-8
  59. set cursorline
  60. set showmatch " matching brackets
  61. set linebreak
  62. set ignorecase " case insensitive matching
  63. set smartcase " smart case matching
  64. "set clipboard+=unnamedplus
  65. set mouse=a
  66. set tabstop=4
  67. set shiftwidth=4
  68. set softtabstop=4
  69. set spelllang=en_us
  70. set showtabline=2
  71. set laststatus=2
  72. set backspace=indent,eol,start " more powerful backspacing
  73. " ------------------
  74. " Basic styling
  75. " ------------------
  76. highlight Comment cterm=italic
  77. highlight CursorLine ctermbg=Black cterm=NONE
  78. highlight CursorLineNr ctermbg=Black cterm=bold ctermfg=Green
  79. highlight LineNr ctermbg=Black ctermfg=White
  80. " ------------------
  81. " Plugin settings
  82. " ------------------
  83. call plug#begin()
  84. Plug 'sonph/onehalf', { 'rtp': 'vim' }
  85. Plug 'vim-airline/vim-airline'
  86. Plug 'vim-airline/vim-airline-themes'
  87. Plug 'preservim/nerdtree'
  88. Plug 'preservim/vim-markdown'
  89. call plug#end()
  90. " Theme configuration
  91. " ------------------
  92. colorscheme onehalfdark "archery
  93. let g:airline_theme = 'onehalfdark' "'archery'
  94. set t_Co=256
  95. let g:airline_powerline_fonts=1
  96. let g:airline#extensions#tabline#left_sep = ' '
  97. let g:airline#extensions#tabline#left_alt_sep = '|'
  98. let g:airline_symbols = {}
  99. let g:airline_symbols.colnr = ' ㏇:'
  100. ```
  101. after copy and paste, or added the require code call the plug installer by entering on command mode in Vim (pressing `Esc` key), then, call `:PlugInstall` to update and install the new Plugins.