diff --git a/.alias b/.alias index 9b14a49..01325d7 100644 --- a/.alias +++ b/.alias @@ -1,2 +1,4 @@ alias g="git" +alias nv="nvim" alias v="vim" +alias dc="docker-compose" diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..c20f8b4 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,137 @@ +:set number +:set relativenumber +:set autoindent +:set tabstop=4 +:set shiftwidth=4 +:set smarttab +:set softtabstop=4 +:set mouse=a + +call plug#begin() + +Plug 'http://github.com/tpope/vim-surround' " Surrounding ysw) +Plug 'https://github.com/preservim/nerdtree' " NerdTree +Plug 'https://github.com/tpope/vim-commentary' " For Commenting gcc & gc +Plug 'https://github.com/vim-airline/vim-airline' " Status bar +Plug 'https://github.com/lifepillar/pgsql.vim' " PSQL Pluging needs :SQLSetType pgsql.vim +Plug 'https://github.com/ap/vim-css-color' " CSS Color Preview +Plug 'https://github.com/rafi/awesome-vim-colorschemes' " Retro Scheme +Plug 'https://github.com/neoclide/coc.nvim' " Auto Completion +Plug 'https://github.com/ryanoasis/vim-devicons' " Developer Icons +Plug 'https://github.com/tc50cal/vim-terminal' " Vim Terminal +Plug 'https://github.com/preservim/tagbar' " Tagbar for code navigation +Plug 'https://github.com/terryma/vim-multiple-cursors' " CTRL + N for multiple cursors + +set encoding=UTF-8 + +call plug#end() + +nnoremap :NERDTreeFocus +nnoremap :NERDTree +nnoremap :NERDTreeToggle +nnoremap :call CocActionAsync('jumpDefinition') + +nmap :TagbarToggle + +:set completeopt-=preview " For No Previews + +:colorscheme jellybeans + +let g:NERDTreeDirArrowExpandable="+" +let g:NERDTreeDirArrowCollapsible="~" + +" --- Just Some Notes --- +" :PlugClean :PlugInstall :UpdateRemotePlugins +" +" :CocInstall coc-python +" :CocInstall coc-clangd +" :CocInstall coc-snippets +" :CocCommand snippets.edit... FOR EACH FILE TYPE + +" air-line +let g:airline_powerline_fonts = 1 + +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif + +" airline symbols +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 = '' + +inoremap pumvisible() ? coc#_select_confirm() : "" +" Enable folding based on Markdown headings + +autocmd FileType markdown setlocal foldmethod=marker +autocmd FileType markdown setlocal foldmarker=##,## + +command! InsertDate execute 'normal! O=strftime("%b %d, %y")' + +nnoremap :InsertDate + +set foldmethod=manual + + + +syntax enable + + +" Custom fold expression for Markdown +function! MarkdownFoldExpr() + " Get the current line + let thisline = getline(v:lnum) + " Get the next line + let nextline = getline(v:lnum + 1) + " Check if the next line contains '##' to determine fold level + if nextline =~ '^##' + return '>1' + else + return '=' + endif +endfunction + +" Set foldmethod to 'expr' and foldexpr to the custom function for Markdown files +autocmd FileType markdown setlocal foldmethod=expr foldexpr=MarkdownFoldExpr() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.prompt b/.prompt index 4d3bf01..4d79368 100644 --- a/.prompt +++ b/.prompt @@ -1,5 +1,5 @@ ## Prompt - +set -o vi function parse_git_branch(){ # Parse the current git branch name and print it which git &>/dev/null || return diff --git a/README.md b/README.md index a971cce..6472136 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,58 @@ # Dotfiles: Configuration Files for Vim, Tmux, and Git -This repository is my personal Configurations file and also comes with an .sh installer. Feel free to configure and personalize the file to suit your preference. +Welcome to my dotfiles repository! This repository contains my personal configuration files for Vim, Tmux, Git, and Neovim, along with installation scripts. Feel free to use these configurations as a starting point and customize them to suit your preferences. -This is the basic sample that you can copy and use. Tips to improve and make it more personalized will be appreciated. +## Contents -Instructions on how to install, use, and personalize will be provided below. +1. `vimrc`: Configuration file for Vim. +2. `tmuxrc`: Configuration file for Tmux. +3. `gitconfig/`: Git configuration files. + - `gitinstall.sh`: Git installation script. +4. `scripts/`: Installation script. + - `install.sh`: Installation script for basic setup. + - `install_enhanced.sh`: Enhanced installation script for additional configurations. +5. `.config/nvim/init.vim`: Configuration file for Neovim. -## Contents +## Installation + +Follow these steps to install and use the configurations provided in this repository: + +### Step 1: Clone the Repository + +Clone the repository to your local machine: + +```bash +git clone https://github.com/Roberamelaek/dotfile.git .dotfiles +``` + +### Step 2: Change into the Repository Directory + +Change into the repository directory: + +```bash +cd .dotfiles +``` + +### Step 3: Run the Basic Installation Script + +Run the basic installation script to set up the configurations: + +```bash +sh scripts/install.sh +``` + +This script installs Vim, Neovim, Tmux, and Git if they are not already installed, and copies the configuration files to your home directory (~/). + +### Step 4: Run the Enhanced Installation (Optional) + +If you want additional configurations, you can run the enhanced installation script: + +```bash +sh scripts/install_enhanced.sh +``` + +This script includes additional configurations beyond the basic setup. Feel free to run it for more customization options. -1. vimrc -2. Tmuxrc -3. gitconfig.sh -4. install.sh - -### Installation - -To install and use the configuration provided in this repository, follow these steps: - -1. Clone the repository to your local machine using the following command: - - ```bash - git clone https://github.com/Roberamelaek/dotfile.git - -2. Rename the dotfile to .dotfile: - - ```bash - mv dotfile .dotfiles - -3. Change into the repository directory: - - ```bash - cd .dotfiles -4. Run the configuration script to install the Vim settings: - ```bash - sh install.sh - -- The files will be copied to your home directory (`~/`) and Vim will be configured accordingly. -- Now you're all set to use the customized Vim configuration! -- Feel free to customize the files before you run sh install.sh have fun with the project and leave feadback for more if you have any questions or helpful and fun ideas!! +### Step 5: Verify Installation +After running the installation script(s), verify that everything is set up correctly by opening Vim, Tmux, or Neovim. If you encounter any issues or have questions, please don't hesitate to report them by opening an issue. diff --git a/gitconfig/gitinstall.sh b/gitconfig/gitinstall.sh old mode 100644 new mode 100755 index 3f30151..e2f057d --- a/gitconfig/gitinstall.sh +++ b/gitconfig/gitinstall.sh @@ -1,8 +1,10 @@ +## Sunday, 2023-50-10 #!/bin/bash # Set up global alias shortcuts for Git configurations git config --global alias.co checkout git config --global alias.br branch +git config --global alias.d diff git config --global alias.ci commit git config --global alias.st status git config --global alias.hist 'log --oneline --decorate --graph' diff --git a/nbrc b/nbrc index 315a8a8..64f8e12 100644 --- a/nbrc +++ b/nbrc @@ -14,8 +14,13 @@ export NB_INDICATOR_PINNED="💖" # https://github.com/xwmx/nb ############################################################################### export NB_ACE_ENABLED=1 -export EDITOR="vim" # Set by `nb` • Tue Jul 4 08:19:36 PM EDT 2023 +export EDITOR="nvim" # Set by `nb` • Tue Jul 4 08:19:36 PM EDT 2023 + +NB_IMAGE_TOOL=imgcat export NB_COLOR_THEME="${NB_COLOR_THEME:-forest}" # Set by `nb` • Thu Jul 6 10:00:16 PM EDT 2023 export NB_INDICATOR_EBOOK="📖" export NB_INDICATOR_NOTEBOOK="📖" + +NB_MARKDOWN_TOOL=glow + diff --git a/install.sh b/scripts/install.sh similarity index 88% rename from install.sh rename to scripts/install.sh index 76d696c..b831c3d 100755 --- a/install.sh +++ b/scripts/install.sh @@ -8,7 +8,7 @@ package_installed() { } # List of packages to check and install -packages=("vim" "tmux" "git") +packages=("vim" "tmux" "git" "neovim") for package in "${packages[@]}"; do if ! package_installed "$package"; then @@ -26,11 +26,13 @@ tmuxrc_path="$HOME/.dotfiles/tmuxrc" vimrc_path="$HOME/.dotfiles/vimrc" gitconfig_path="$HOME/.dotfiles/gitconfig" gitinstall_path="$HOME/.dotfiles/gitconfig/gitinstall.sh" +init_vim_path="$HOME/.dotfiles/.config/nvim/init.vim" # Set the destination directories for the symbolic links nbrc_dest="$HOME/.nbrc" tmuxrc_dest="$HOME/.tmux.conf" vimrc_dest="$HOME/.vimrc" +init_vim_dest="$HOME/.config/nvim/init.vim" # Function to create or recreate symbolic links create_symlink() { @@ -50,12 +52,13 @@ create_symlink() { create_symlink "$nbrc_path" "$nbrc_dest" create_symlink "$tmuxrc_path" "$tmuxrc_dest" create_symlink "$vimrc_path" "$vimrc_dest" +create_symlink "$init_vim_path" "$init_vim_dest" # Run the gitinstall.sh script bash "$gitinstall_path" # Array of file names to source -files=("prompt" "alias") +files=("alias" "prompt") # Add source commands to .bashrc for each file for file in "${files[@]}"; do @@ -64,4 +67,3 @@ for file in "${files[@]}"; do echo "source $filepath" >> "$HOME/.bashrc" fi done - diff --git a/scripts/install_init_vim.sh b/scripts/install_init_vim.sh new file mode 100644 index 0000000..0467a8d --- /dev/null +++ b/scripts/install_init_vim.sh @@ -0,0 +1,19 @@ + + +SOURCE="$HOME/.dotfiles/.config/nvim/init.vim" +DESTINATION="$HOME/.config/nvim/init.vim" + +if [ -f "$SOURCE" ]; then + + if [ -f "$DESTINATION" ]; then + + rm "$DESTINATION" + + echo "Existing init.vim deleted." + + fi + + cp "$SOURCE" "$DESTINATION" + echo "init.vim copied successfully." +else + echo "SOURCE init.vim file not found in ~ diff --git a/tmuxrc b/tmuxrc index dbac131..c6b62c4 100644 --- a/tmuxrc +++ b/tmuxrc @@ -2,4 +2,14 @@ unbind-key C-b set-option -g prefix C-a bind-key C-a send-prefix +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +# Use hjkl for window navigation +setw -g mode-keys vi +# Enable vim-like pane navigation using hjkl +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R +