Compare commits

...

3 commits

8 changed files with 338 additions and 14 deletions

28
bat/config Normal file
View file

@ -0,0 +1,28 @@
# This is `bat`s configuration file. Each line either contains a comment or
# a command-line option that you want to pass to `bat` by default. You can
# run `bat --help` to get a list of all possible configuration options.
# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
# for a list of all available themes
--theme="OneHalfLight"
# same as full, unless the output is piped.
--style="auto"
# Enable this to use italic text on the terminal. This is not supported on all
# terminal emulators (like tmux, by default):
--italic-text=always
# Uncomment the following line to disable automatic paging:
#--paging=never
# Uncomment the following line if you are using less version >= 551 and want to
# enable mouse scrolling support in `bat` when running inside tmux. This might
# disable text selection, unless you press shift.
#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
# Syntax mappings: map a certain filename pattern to a language.
# Example 1: use the C++ syntax for Arduino .ino files
# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
#--map-syntax "*.ino:C++"
#--map-syntax ".ignore:Git Ignore"

View file

@ -1 +0,0 @@
/home/tine/Projects/workspace/bin

View file

@ -2,13 +2,18 @@
name = Tine Jozelj name = Tine Jozelj
email = tine@tjo.space email = tine@tjo.space
#signingkey = 3818B74E3830D7CF #signingkey = 3818B74E3830D7CF
[commit] [commit]
#gpgsign = true #gpgsign = true
[init] [init]
defaultBranch = main defaultBranch = main
[filter "lfs"] [filter "lfs"]
smudge = git-lfs smudge -- %f smudge = git-lfs smudge -- %f
process = git-lfs filter-process process = git-lfs filter-process
required = true required = true
clean = git-lfs clean -- %f clean = git-lfs clean -- %f
[diff]
external = difft

View file

@ -15,6 +15,24 @@ workspace_link() {
ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true
} }
echo "== manjaro packages"
if cat /etc/lsb-release | grep Manjaro > /dev/null
then
sudo pacman -Syu
sudo pacman -S \
git \
bat \
difftastic \
vim \
neovim \
zsh \
tmux \
starship \
nodejs \
ripgrep \
fd
fi
echo "== zplug" echo "== zplug"
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh || true curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh || true
@ -57,8 +75,18 @@ workspace_link alacritty/alacritty.yml .alacritty.yml
workspace_backup .config/kitty/kitty.conf workspace_backup .config/kitty/kitty.conf
workspace_link kitty/kitty.conf .config/kitty/kitty.conf workspace_link kitty/kitty.conf .config/kitty/kitty.conf
# BAT
workspace_backup .config/bat/config
workspace_link bat/config .config/bat/config
# VIM # VIM
workspace_backup .vimrc workspace_backup .vimrc
workspace_link vim/vimrc .vimrc workspace_link vim/vimrc .vimrc
workspace_backup .vim/coc-settings.json workspace_backup .vim/coc-settings.json
workspace_link vim/coc-settings.json .vim/coc-settings.json workspace_link vim/coc-settings.json .vim/coc-settings.json
# NEOVIM
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
workspace_backup .config/nvim/init.vim
workspace_link nvim/init.vim .config/nvim/init.vim

255
nvim/init.vim Normal file
View file

@ -0,0 +1,255 @@
" Run PlugInstall if there are missing plugins
autocmd VimEnter *
\ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
\| PlugInstall --sync | q
\| endif
"""""
"--- Plugins
call plug#begin('~/.vim/plugged')
" General
Plug 'ojroques/vim-oscyank'
Plug 'tpope/vim-obsession'
Plug 'tmux-plugins/vim-tmux-focus-events'
" Look
Plug 'vim-airline/vim-airline'
Plug 'sonph/onehalf', { 'rtp': 'vim' }
Plug 'Yggdroot/indentLine'
" Git
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
" Search/Files
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'ANGkeith/telescope-terraform-doc.nvim'
Plug 'fannheyward/telescope-coc.nvim'
" Ignore/Edit files
Plug 'vim-scripts/gitignore'
" Coding helpers
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
"""""
"--- CodeServer Configurations
let g:coc_global_extensions = [
\ 'coc-tsserver',
\ 'coc-prettier',
\ 'coc-yaml',
\ 'coc-json',
\ 'coc-git',
\ 'coc-pyright',
\ 'coc-pairs',
\ 'coc-prisma',
\ 'coc-sh',
\ ]
if isdirectory('./node_modules') && isdirectory('./node_modules/prettier')
let g:coc_global_extensions += ['coc-prettier']
endif
if isdirectory('./node_modules') && isdirectory('./node_modules/eslint')
let g:coc_global_extensions += ['coc-eslint']
endif
" Diagnostic list
nnoremap <silent> <space>d :<C-u>CocList diagnostics<cr>
" Symbols list
nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
" Code actions
nmap <leader>do <Plug>(coc-codeaction)
" Rename current world
nmap <leader>rn <Plug>(coc-rename)
" Use K to show documentation in preview window.
nnoremap <silent> K :call ShowDocumentation()<CR>
function! ShowDocumentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
"""""
"--- TMUX/Clipboard fixes
set t_Co=256
set t_ut=
" Set Vim-specific sequences for RGB colors
" Fixes 'termguicolors' usage in vim+tmux
" :h xterm-true-color
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
" Enables 24-bit RGB color in the terminal
if has('termguicolors')
if empty($COLORTERM) || $COLORTERM =~# 'truecolor\|24bit'
set termguicolors
endif
endif
" Use system clipboard to get buffers synced between TMUX and VIM
if has('clipboard') && has('vim_starting')
" set clipboard& clipboard+=unnamedplus
set clipboard& clipboard^=unnamed,unnamedplus
endif
if exists('##TextYankPost')
augroup BlinkClipboardIntegration
autocmd!
autocmd TextYankPost * if v:event.operator is 'y' && v:event.regname is '' | execute 'OSCYankReg "' | endif
augroup END
endif
""""
"--- Treesitter configuration
lua <<EOF
require'nvim-treesitter.configs'.setup {
ensure_installed = {
"python",
"bash",
"dockerfile",
"go",
"graphql",
"hcl",
"javascript",
"json",
"make",
"markdown",
"prisma",
"proto",
"rust",
"typescript",
"vim",
"yaml"
},
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
highlight = {
-- `false` will disable the whole extension
enable = true,
-- list of language that will be disabled
disable = { "" },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
indent = {
-- dont enable this, messes up python indentation
enable = false,
disable = {},
},
}
EOF
"""""
"--- Telescope Configuration
lua <<EOF
require'telescope'.setup {
defaults = {
layout_strategy = 'vertical',
},
extensions = {
terraform_doc = {
url_open_command = "xdg-open",
latest_provider_symbol = "  ",
wincmd = "botright new",
wrap = "nowrap",
}
}
}
require'telescope'.load_extension('terraform_doc')
require'telescope'.load_extension('coc')
EOF
"""""
"--- VIM Configuration
set encoding=UTF-8
set autoread " will re-read opened file if changed externaly
set autowrite
set splitright
set splitbelow
" Use spaces (2) instead of tabs
set autoindent
set smartindent
set expandtab
set tabstop =2
set softtabstop=2
set shiftwidth =2
set noswapfile
set nobackup
set nowritebackup
set incsearch " search as you type
set ignorecase
set smartcase
set mouse=a
set spell spelllang=en_us
set updatetime=300
set cmdheight=2
set hidden
set shortmess+=c
"""""
"- Custom commands
command! -nargs=0 Prettier :CocCommand prettier.formatFile
"""""
"- Keybindings
" Using SPACE as <leader> key
nnoremap <SPACE> <Nop>
let mapleader = " "
" Telescope
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
" Telescope git
nnoremap <leader>fgc <cmd>Telescope git_commits<cr>
nnoremap <leader>fgb <cmd>Telescope git_branches<cr>
nnoremap <leader>fgs <cmd>Telescope git_status<cr>
" Telescope Terraform
nnoremap <leader>ftf <cmd>Telescope terraform_doc<cr>
nnoremap <leader>ftm <cmd>Telescope terraform_doc modules<cr>
nnoremap <leader>ftfa <cmd>Telescope terraform_doc full_name=hashicorp/aws<cr>
nnoremap <leader>ftfk <cmd>Telescope terraform_doc full_name=hashicorp/kubernetes<cr>
" Telescope coc
nnoremap <leader>fca <cmd>Telescope coc code_actions<cr>
nnoremap <leader>fcr <cmd>Telescope coc references<cr>
nnoremap <leader>fcdi <cmd>Telescope coc diagnostics<cr>
nnoremap <leader>fcde <cmd>Telescope coc definitions<cr>
nnoremap <leader>fcds <cmd>Telescope coc document_symbols<cr>
nnoremap <leader>fcws <cmd>Telescope coc workspace_symbols<cr>
"""""
"- Visuals
set noshowmode
set number
set cursorline
set hlsearch " highlight all results
set signcolumn=number " always show git diff column
colorscheme onehalflight
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.branch = ''
let g:airline_symbols.dirty=' '
let g:airline_symbols.linenr = '☰ '
let g:airline_symbols.maxlinenr = ' '
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:airline_detect_spell=0
let g:airline#extensions#coc#enabled = 1
let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]'
let g:airline_theme = 'onehalflight'

View file

@ -1,5 +1,12 @@
bind c new-window -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}"
# Needed for NVIM
set-option -sg escape-time 10
# History
set-option -g history-limit 50000
# Vim mode
set -g status-keys vi set -g status-keys vi
setw -g mode-keys vi setw -g mode-keys vi

View file

@ -137,11 +137,9 @@ set splitright
set splitbelow set splitbelow
set autoindent set autoindent
set tabstop=4 set tabstop=2
set shiftwidth=2 set shiftwidth=2
set softtabstop=0
set expandtab set expandtab
set smarttab
set noswapfile set noswapfile
set nobackup set nobackup

View file

@ -41,6 +41,10 @@ bindkey -v
bindkey -M vicmd "?" history-incremental-search-backward bindkey -M vicmd "?" history-incremental-search-backward
bindkey -M vicmd "/" history-incremental-search-forward bindkey -M vicmd "/" history-incremental-search-forward
# Aliases
alias gicm="git checkout main && git pull"
alias gic="git checkout"
# PATH # PATH
export PATH=$PATH:$HOME/.bin:$HOME/go/bin export PATH=$PATH:$HOME/.bin:$HOME/go/bin