Skip to content
Open

Dev #17

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .alias
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
alias g="git"
alias nv="nvim"
alias v="vim"
alias dc="docker-compose"
137 changes: 137 additions & 0 deletions .config/nvim/init.vim
Original file line number Diff line number Diff line change
@@ -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 <C-f> :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have a conflicting shortcut between your NERDTree and Multiple cursors

nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-l> :call CocActionAsync('jumpDefinition')<CR>

nmap <F8> :TagbarToggle<CR>

: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 <expr> <Tab> pumvisible() ? coc#_select_confirm() : "<Tab>"
" Enable folding based on Markdown headings

autocmd FileType markdown setlocal foldmethod=marker
autocmd FileType markdown setlocal foldmarker=##,##

command! InsertDate execute 'normal! O<C-R>=strftime("%b %d, %y")<CR>'

nnoremap <C-C><C-C> :InsertDate<CR>

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()






































2 changes: 1 addition & 1 deletion .prompt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
85 changes: 51 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <code>sh install.sh</code> 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.
2 changes: 2 additions & 0 deletions gitconfig/gitinstall.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
7 changes: 6 additions & 1 deletion nbrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼


8 changes: 5 additions & 3 deletions install.sh → scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand All @@ -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
Expand All @@ -64,4 +67,3 @@ for file in "${files[@]}"; do
echo "source $filepath" >> "$HOME/.bashrc"
fi
done

19 changes: 19 additions & 0 deletions scripts/install_init_vim.sh
Original file line number Diff line number Diff line change
@@ -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 ~
10 changes: 10 additions & 0 deletions tmuxrc
Original file line number Diff line number Diff line change
Expand Up @@ -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