Compare commits

...

4 Commits

Author SHA1 Message Date
054cea8511 scripts : some script added 2024-08-26 13:39:36 +09:00
0df06aef69 emacs : copilot support 2024-08-26 13:38:57 +09:00
1bdcedb34b sxhkd : bind screenshot key 2024-08-26 13:07:14 +09:00
0f6b4b6cd8 change vim config lua style. 2024-08-26 13:06:22 +09:00
21 changed files with 284 additions and 159 deletions

View File

@ -47,6 +47,9 @@
custom-org-roam-directory "~/org/roam"
custom-org-agenda-file "~/org/agenda/agenda.org")
;; Line numbers, relative or comment this line
(setq display-line-numbers-type 'relative)
;; Chatgpt setup
(setq custom-chatgpt-my-key "my-key")

View File

@ -114,5 +114,7 @@ Otherwise the startup will be very slow. "
(require 'init-extra)
(require 'init-chatgpt)
(require 'init-copilot)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init.el ends here

View File

@ -0,0 +1,8 @@
;; init-copilot.el -*- lexical-binding: t -*-
(add-to-list 'load-path "~/.config/emacs/copilot.el")
(require 'copilot)
(add-hook 'prog-mode-hook 'copilot-mode)
(provide 'init-copilot)
;;; init-copilot.el ends here

15
.config/nvim/init.lua Normal file
View File

@ -0,0 +1,15 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins")
require("vim-options")

View File

@ -1,129 +0,0 @@
" Vim Configuration
set nocompatible "move using arrow key
"filtype plugin on
set number
set ai "auto indent
set si "smart indent
set cindent " c style indent
set shiftwidth=4 "shift order 4step
set tabstop=4 "tab order 4step
set hlsearch "highlight empathize the word.
set history=1000 "history store depth
set nobackup "no generate swp file
set noswapfile
set nowritebackup
set backupdir=~/.backup/
set directory=~/.backup/
set ruler "display the cursor position
set title "display the title
set showmatch "display the matched bracket
"set nowrap "no auto linefeed
set wmnu "auto word finder
set autochdir " auto change working directory
set hidden "buffer hidden
set updatetime=300 " 300ms
set cmdheight=2 " Better display for messages
set shortmess+=c " don't give [ins-completion-menu] messages.
set signcolumn=yes " always show signcolumns
set backspace=indent,eol,start
set fencs=ucs-bom,utf-8,cp949
set clipboard^=unnamed,unnamedplus
set mouse=a
" PluginManager in vimrc
runtime plugList.vim
"""""""""""""""""""""""""""""""""""""""""""""""""""
" Colorscheme
"""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""" One Dark
"colorscheme onedark
"""""""""""""" Grub_box
let g:gruvbox_contrast_dark='soft'
set background=dark
colorscheme gruvbox
let g:airline_theme='gruvbox'
"""""""""""""" Paper Color
"set background=light
"colorscheme PaperColor
"let g:airline_theme='hybrid'
"let g:PaperColor_Theme_Options = {
" \ 'theme': {
" \ 'default.light': {
" \ 'transparent_background': 1
" \ }
" \ }
" \ }
"""""""""""""" Molokai
"let g:molokai_original = 1
"colorscheme molokai
"""""""""""""" Solarized 8
"set background=light
"colorscheme solarized8_high
"let g:airline_theme='solarized8'
"""""""""""""" Challenger Deep
"colorscheme challenger_deep
"colorscheme palenight
"""""""""""""""""""""""""""""""""""""""""""""""""""
" Air-line
"""""""""""""""""""""""""""""""""""""""""""""""""""
let g:airline#extensions#tabline#enabled = 1 " turn on buffer list
set laststatus=2 " turn on bottom bar
""""""""""""""""""""""""""""""""""""""""""""""""""
" Git Gutter
""""""""""""""""""""""""""""""""""""""""""""""""""
let g:gitgutter_highlight_lines = 1
map <F4> :GitGutterLineHighlightsToggle<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""
" easymotion
""""""""""""""""""""""""""""""""""""""""""""""""""
" <Leader>f{char} to move to {char}
"map <Leader>f <Plug>(easymotion-bd-f)
"nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
nmap <Leader>s <Plug>(easymotion-overwin-f2)
" Move to line
"map <Leader>L <Plug>(easymotion-bd-jk)
"nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
map <C-c> "+ygv"*y
map <C-n> "+p
map <F12> :cd %:p:h<cr>:term bash<cr>
map <F7> @a
map <F8> "byaw/incNumber/b
cw"bp
""""""""""""""""""""""""""""""""""""""""""""""""""
" Visual-star (Search using * / in visual modde)
""""""""""""""""""""""""""""""""""""""""""""""""""
xnoremap * :<C-u>call <SID>VSetSearch('/')<CR>/<C-R>=@/<CR><CR>
xnoremap # :<C-u>call <SID>VSetSearch('?')<CR>?<C-R>=@/<CR><CR>
function! s:VSetSearch(cmdtype)
let temp = @s
norm! gv"sy
let @/ = '\V' . substitute(escape(@s, a:cmdtype.'\'), '\n', '\\n', 'g')
let @s = temp
endfunction

View File

@ -0,0 +1 @@
return {}

View File

@ -0,0 +1,25 @@
return {
{
"tpope/vim-unimpaired",
config = function()
end
},
{
"tpope/vim-commentary",
config = function()
end
},
{
"tpope/vim-surround",
config = function()
end
},
{
"easymotion/vim-easymotion",
config = function()
vim.keymap.set('n', '<Leader>s', '<Plug>(easymotion-overwin-f2)', {})
vim.keymap.set('n', '<Leader>w', '<Plug>(easymotion-bd-w)', {})
-- vim.keymap.set('n', '<Leader>w', '<Plug>(easymotion-bd-w)', {})
end
},
}

View File

@ -0,0 +1,14 @@
return {
{
"tpope/vim-fugitive", -- git wrapper
config = function()
end
},
{
"airblade/vim-gitgutter", -- git modified view;
config = function()
vim.g.gitgutter_highlight_lines = 1
vim.keymap.set({'n', 'v'}, '<F4>', ':GitGutterLineHighlightsToggle<cr>', {})
end
},
}

View File

@ -0,0 +1,25 @@
return {
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = {"lua_ls", "clangd", "cmake", "cssls", "html"}
})
end
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
end
}
}

View File

@ -0,0 +1,12 @@
return {
'nvim-lualine/lualine.nvim',
config = function()
require('lualine').setup({
options = {
icons_enabled = true,
theme = 'auto'
}
})
end
}

View File

@ -0,0 +1,12 @@
return {
"nvim-neo-tree/neo-tree.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.keymap.set('n', '<F8>', ':Neotree filesystem reveal left<CR>', {})
-- vim.keymap.set('n', '<C-n>', ':Neotree filesystem reveal left<CR>', {})
end
}

View File

@ -0,0 +1,6 @@
return {
'lambdalisue/suda.vim',
config = function()
end
}

View File

@ -0,0 +1,49 @@
return {
{
"NLKNguyen/papercolor-theme",
config = function()
-- vim.cmd("set background=light")
-- vim.cmd.colorscheme "PaperColor"
end
},
{
"tomasr/molokai",
config = function()
-- vim.cmd.colorscheme "molokai"
end
},
{
"joshdick/onedark.vim",
config = function()
-- vim.cmd.colorscheme "onedark"
end
},
{
'morhetz/gruvbox',
config = function()
-- vim.g.gruvbox_contrast_dark='soft'
-- vim.cmd("set background=dark")
-- vim.cmd.colorscheme "gruvbox"
end
},
{
"drewtempelmeyer/palenight.vim",
config = function()
-- vim.cmd.colorscheme "palenight"
end
},
{
"challenger-deep-theme/vim",
name = "challenger_deep",
config = function()
-- vim.cmd.colorscheme "challenger_deep"
end
},
{
"catppuccin/nvim",
config = function()
vim.cmd.colorscheme "catppuccin"
end
},
}

View File

@ -0,0 +1,12 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = {"lua", "c", "rust", "verilog"},
highlight = { enable = true },
indent = { enable = true }
})
end
}

View File

@ -0,0 +1,53 @@
-- Vim Configuration
vim.cmd("set nocompatible") -- move using arrow key
-- filtype plugin on
vim.cmd("set number")
vim.cmd("set ai") -- auto indent
vim.cmd("set si") -- smart indent
vim.cmd("set cindent") -- c style indent
vim.cmd("set shiftwidth=4") -- shift order 4step
vim.cmd("set tabstop=4") -- tab order 4step
vim.cmd("set hlsearch") -- highlight empathize the word.
vim.cmd("set history=1000") -- history store depth
vim.cmd("set nobackup") -- no generate swp file
vim.cmd("set noswapfile")
vim.cmd("set nowritebackup")
vim.cmd("set backupdir=~/.backup/")
vim.cmd("set directory=~/.backup/")
vim.cmd("set ruler") -- display the cursor position
vim.cmd("set title") -- display the title
vim.cmd("set showmatch") -- display the matched bracket
-- set nowrap "no auto linefeed
vim.cmd("set wmnu") -- auto word finder
vim.cmd("set autochdir") -- auto change working directory
vim.cmd("set hidden") -- buffer hidden
vim.cmd("set updatetime=300") -- 300ms
vim.cmd("set cmdheight=2") -- Better display for messages
vim.cmd("set shortmess+=c") -- don't give [ins-completion-menu] messages.
vim.cmd("set signcolumn=yes") -- always show signcolumns
vim.cmd("set backspace=indent,eol,start")
vim.cmd("set fencs=ucs-bom,utf-8,cp949")
-- vim.cmd("set clipboard^=unnamed,unnamedplus")
vim.cmd("set clipboard+=unnamedplus")
vim.cmd("set mouse=a")
-- normal
vim.keymap.set('n', '<C-h>', '<C-w>h', {})
vim.keymap.set('n', '<C-l>', '<C-w>l', {})
vim.keymap.set('n', '<C-j>', '<C-w>j', {})
vim.keymap.set('n', '<C-k>', '<C-w>k', {})
-- vim.keymap.set('n', '<C-c>', '"*y', {})
-- vim.keymap.set('n', '<C-n>', '"*p', {})
--
vim.keymap.set('n', '<F12>', ':cd %:p:h<cr>:term zsh<cr>', {})
vim.keymap.set('n', '<F7>', '@a', {})

View File

@ -1,25 +0,0 @@
call plug#begin('~/.vim/plugged')
Plug 'lambdalisue/suda.vim'
" color scheme
Plug 'morhetz/gruvbox'
"Plug 'lifepillar/vim-solarized8'
"Plug 'NLKNguyen/papercolor-theme'
"Plug 'tomasr/molokai'
"Plug 'joshdick/onedark.vim'
"Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' }
Plug 'drewtempelmeyer/palenight.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive' " git wrapper
Plug 'airblade/vim-gitgutter' " git modified view;
Plug 'tpope/vim-surround'
Plug 'easymotion/vim-easymotion'
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()

View File

@ -24,6 +24,10 @@ super+shift+c
bspc node -c
super+shift+q
killall picom & killall sxhkd & bspc quit
super+s
scrot -e 'xclip -selection clipboard -t image/png -i $f'
super+shift+s
scrot -s -e 'xclip -selection clipboard -t image/png -i $f'
super+shift+e
rofi -mode drun -theme solarized -font "hack 20" -show combi
alt+Tab

8
.zshrc
View File

@ -35,11 +35,9 @@ alias ytv-best="youtube-dl -f bestvideo+bestaudio "
alias startsv="ssh odroid startsv"
alias stopsv="ssh odroid stopsv"
alias ls="exa -al --color=always --group-directories-first"
alias la="exa -a --color=always --group-directories-first"
alias ll="exa -l --color=always --group-directories-first"
alias lt="exa -aT --color=always --group-directories-first"
alias l.='exa -a | egrep "^\."'
alias ls="eza -a --icons"
alias ll="eza -al --icons"
alias lt="eza -a --tree --level=1 --icons"
# WSL2
if [[ $JUPCID == "WSL" ]];then

16
scripts/color_test.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Based on: https://gist.github.com/XVilka/8346728
awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{
s="/\\";
for (colnum = 0; colnum<term_cols; colnum++) {
r = 255-(colnum*255/term_cols);
g = (colnum*510/term_cols);
b = (colnum*255/term_cols);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "%s\033[0m", substr(s,colnum%2+1,1);
}
printf "\n";
}'

21
scripts/merge_all_files.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "Usage : ./merge_all_files.sh [dir] [pattern] [file]"
exit
fi
pushd $1
find . -type f -name "*.$2" -exec sh -c 'cat "{}"' >> $3 \;
popd
# files=()
# while IFS= read -r -d $'\0'; do
# files+=("$REPLY")
# done < <(find . -type f -name "*.$1" -print0)
# echo $files
# for file in files; do
# echo $file
# done

3
scripts/take_screenshot.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
scrot -e 'xclip -selection clipboard -t image/png -i $f'