Compare commits

..

1 Commits

Author SHA1 Message Date
a79592c91d Update sway/config 2026-02-16 07:16:19 +00:00
18 changed files with 694 additions and 408 deletions

45
.zshrc
View File

@@ -2,36 +2,51 @@
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=2000
SAVEHIST=2000
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
bindkey "\e[3~" delete-char
autoload -Uz compinit && compinit
zstyle ':completion:*' menu select
autoload -Uz compinit
compinit
# End of lines added by compinstall
# zsh extensionst
source /data/kits/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source /data/kits/zsh/powerlevel10k/powerlevel10k.zsh-theme
source /data/kits/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
eval `dircolors /data/kits/zsh/dircolor/bliss.dircolors`
source /home/nnduc/git/powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export PATH="$HOME/.local/bin:$PATH"
export PATH="/data/runtimes/julia/bin/:$PATH"
export PATH="/data/runtimes/gurobi/linux64/bin/:$PATH"
export PATH="/data/runtimes/conda/bin:$PATH"
export PATH="/data/runtimes/nodejs/bin:$PATH"
export EDITOR=nvim
export TERM='xterm-256color'
alias ls='ls --color=auto'
# >>> juliaup initialize >>>
# !! Contents within this block are managed by juliaup !!
path=('/data/runtimes/julia/bin' $path)
export PATH
# <<< juliaup initialize <<<
zshaddhistory() {
whence ${${(z)1}[1]} >/dev/null || return 2
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export EDITOR=nvim
export TERM='xterm-256color'
export PATH="$HOME/.local/bin:$PATH"
alias ls='ls --color=auto'
alias doc='docker-compose'
source ~/git/zsh-autosuggestions/zsh-autosuggestions.zsh

View File

@@ -16,20 +16,9 @@ family = "MesloLGS NF"
[font.normal]
family = "MesloLGS NF"
[[keyboard.bindings]]
key = "T"
mods = "Control|Shift"
action = "SpawnNewInstance"
[[keyboard.bindings]]
key = "PageUp"
action = "ScrollLineUp"
[[keyboard.bindings]]
key = "PageDown"
action = "ScrollLineDown"
[[keyboard.bindings]]
key = "Return"
mods = "Shift"
chars = "\u001b\r"
[keyboard]
bindings = [
{ key = "T", mods = "Control|Shift", action = "SpawnNewInstance" },
{ key = "PageUp", action = "ScrollLineUp" },
{ key = "PageDown", action = "ScrollLineDown" },
]

View File

@@ -1,24 +0,0 @@
[window]
startup_mode = "Maximized"
[font]
size = 14.0
[font.bold]
family = "MesloLGS NF"
[font.bold_italic]
family = "MesloLGS NF"
[font.italic]
family = "MesloLGS NF"
[font.normal]
family = "MesloLGS NF"
[keyboard]
bindings = [
{ key = "T", mods = "Control|Shift", action = "SpawnNewInstance" },
{ key = "PageUp", action = "ScrollLineUp" },
{ key = "PageDown", action = "ScrollLineDown" },
]

View File

@@ -10,8 +10,7 @@
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod1
set $wallpaper '/home/nnduc/sync/images/wallpapers/suse.png'
set $terminal 'xfce4-terminal'
set $wallpaper '/data/sync/images/wallpapers/suse.png'
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:NotoSans 12
@@ -28,11 +27,11 @@ exec --no-startup-id dex --autostart --environment i3
# they are included here as an example. Modify as you see fit.
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use systemctl lock-session to lock your screen.
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xrand --output HDMI-0 --mode 1920x1080 --rate 120
bindsym $mod+l exec i3lock --ignore-empty-password -i $wallpaper
bindsym $mod+Shift+p exec systemctl poweroff
bindsym $mod+Shift+p exec loginctl poweroff
bindsym Print exec flameshot gui -c
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
@@ -41,11 +40,13 @@ bindsym Print exec flameshot gui -c
exec --no-startup-id fcitx5 -d
exec --no-startup-id nm-applet
exec --no-startup-id blueman-applet
exec --no-startup-id kwalletd6
exec --no-startup-id feh --bg-fill $wallpaper
exec --no-startup-id owncloud
exec --no-startup-id pasystray
exec --no-startup-id polybar
exec --no-startup-id xset m 1/1 0
exec xinput --set-prop "Razer Razer DeathAdder V2 X HyperSpeed Mouse" "Device Accel Constant Deceleration" 3
exec --no-startup-id gentoo-pipewire-launcher restart &
set $refresh_i3status killall -SIGUSR1 i3status
@@ -86,9 +87,9 @@ floating_modifier $mod
#tiling_drag modifier titlebar
#xrandr --output HDMI-2 --auto --right-of eDP1
# start a terminal
# start a 3terminal
#bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec $terminal
bindsym $mod+Return exec alacritty
# kill focused window
bindsym $mod+Shift+q kill

View File

@@ -1,87 +0,0 @@
-- Minimal server editor config
-- Launch with: NVIM_APPNAME=nvim-server nvim
-------------------- Options --------------------
vim.g.mapleader = ","
vim.opt.number = true
vim.opt.cursorline = true
vim.opt.expandtab = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.hlsearch = true
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "no"
vim.opt.updatetime = 250
vim.opt.undofile = true
vim.opt.clipboard = "unnamedplus"
-------------------- Keymaps --------------------
vim.keymap.set("n", "i", ":nohls<CR>i", { silent = true })
vim.keymap.set("n", "<Space>", ":w<CR>", { silent = true })
-- Window navigation
vim.keymap.set("n", "<C-h>", "<C-W>h")
vim.keymap.set("n", "<C-j>", "<C-W>j")
vim.keymap.set("n", "<C-k>", "<C-W>k")
vim.keymap.set("n", "<C-l>", "<C-W>l")
vim.keymap.set("n", "<C-Left>", "<C-W>h")
vim.keymap.set("n", "<C-Down>", "<C-W>j")
vim.keymap.set("n", "<C-Up>", "<C-W>k")
vim.keymap.set("n", "<C-Right>", "<C-W>l")
-- Tab management
vim.keymap.set("n", "<leader>to", ":tabonly<CR>", { silent = true })
vim.keymap.set("n", "<leader>o", ":only<CR>", { silent = true })
vim.keymap.set("n", "<leader><Tab>", ":tabn<CR>", { silent = true })
vim.keymap.set("n", "<S-Tab>", ":tabp<CR>", { silent = true })
-------------------- Netrw (built-in file browser) --------------------
vim.g.netrw_banner = 0
vim.g.netrw_liststyle = 3
vim.keymap.set("n", "<F2>", ":Explore<CR>", { silent = true })
-------------------- Statusline (built-in) --------------------
vim.opt.statusline = " %f %m%r%= %y %l:%c %p%% "
-------------------- Bootstrap lazy.nvim --------------------
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if vim.fn.isdirectory(lazypath) == 0 then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ "4ree/viml-surround", event = "VeryLazy" },
{ "numToStr/Comment.nvim", event = "VeryLazy", opts = {} },
{
"junegunn/fzf.vim",
dependencies = { "junegunn/fzf" },
keys = {
{ "<leader>f", "<cmd>Files<CR>", desc = "Find files" },
{ "<leader>b", "<cmd>Buffers<CR>", desc = "Buffers" },
{ "<leader>r", "<cmd>Rg<CR>", desc = "Ripgrep" },
{ "<leader>g", "<cmd>GFiles<CR>", desc = "Git files" },
},
},
})
-------------------- Grep (use ripgrep if available) --------------------
if vim.fn.executable("rg") == 1 then
vim.opt.grepprg = "rg --vimgrep --smart-case"
vim.opt.grepformat = "%f:%l:%c:%m"
end

143
nvim/.vimrc Normal file
View File

@@ -0,0 +1,143 @@
syntax on
set number
set cursorline
set expandtab tabstop=4 shiftwidth=4 softtabstop=4
set autoindent
set spelllang=vi,en
" Fold
set foldmethod=syntax
set foldlevel=1
set foldnestmax=1
set encoding=utf8
" Search
set hlsearch
nnoremap i :nohls<CR>i
" Plugin
call plug#begin()
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'dense-analysis/ale'
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'lervag/vimtex'
Plug 'JuliaEditorSupport/julia-vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'honza/vim-snippets'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'kevinhwang91/nvim-bqf'
Plug 'morhetz/gruvbox'
Plug 'tpope/vim-fugitive'
Plug 'ynkdir/vim-diff'
Plug '4ree/vim-ime'
call plug#end()
"Color scheme
"colorscheme iceberg
"set background=light
colorscheme gruvbox
let g:gruvbox_contrast_light = 'hard'
hi clear SpellBad
hi SpellBad cterm=underline ctermfg=red
"Open NERDTree
:nnoremap <silent> <expr> <F2> g:NERDTree.IsOpen() ? "\:NERDTreeClose<CR>" : bufexists(expand('%')) ? "\:NERDTreeFind<CR>" : "\:NERDTree<CR>"
"Coc.nvim
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ CheckBackSpace() ? "\<TAB>" :
\ coc#refresh()
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackSpace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Comments
let mapleader = ","
" remap save
nnoremap <space> :w<CR>
" moving between windows
nnoremap <C-h> <C-W>h
nnoremap <C-j> <C-W>j
nnoremap <C-k> <C-W>k
nnoremap <C-l> <C-W>l
nnoremap <C-Left> <C-W>h
nnoremap <C-Down> <C-W>j
nnoremap <C-Up> <C-W>k
nnoremap <C-Right> <C-W>l
nnoremap <leader>to :tabonly<CR>
nnoremap <leader>o :only<CR>
nnoremap <leader><tab> :tabn<CR>
nnoremap <S-tab> :tabp<CR>
"set clipboard+=unnamedplus
" " Copy to clipboard
vnoremap <leader>y "+y
nnoremap <leader>Y "+yg_
nnoremap <leader>y "+y
nnoremap <leader>yy "+yy
" " Paste from clipboard
nnoremap <leader>p "+p
nnoremap <leader>P "+P
" FZF key mapping
nnoremap <silent> <Leader>b :Buffers<CR>
nnoremap <silent> <Leader>r :Rg<CR>
nnoremap <silent> <Leader>f :Files<CR>
nnoremap <silent> <Leader>g :GFiles<CR>
nnoremap <silent> <Leader>w :Rg <C-R><C-W><CR>
filetype plugin on
set splitright
set splitbelow
let g:vimtex_view_method= 'zathura'
"Language tool
map <F3> :ALEToggle<CR>
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
if &term =~ 'xterm' || &term == 'win32'
" Use DECSCUSR escape sequences
let &t_SI = "\e[5 q" " blink bar
let &t_SR = "\e[3 q" " blink underline
let &t_EI = "\e[1 q" " blink block
let &t_ti ..= "\e[1 q" " blink block
let &t_te ..= "\e[0 q" " default (depends on terminal, normally blink
" block)
endif

2
nvim/coc-settings.json Normal file
View File

@@ -0,0 +1,2 @@
{"coc.preferences.diagnostic.displayByAle":1
}

View File

@@ -1,218 +0,0 @@
-- Leader key (must be set before lazy.nvim loads)
vim.g.mapleader = ","
-------------------- Options --------------------
vim.opt.number = true
vim.opt.cursorline = true
vim.opt.expandtab = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
vim.opt.autoindent = true
vim.opt.spelllang = "vi,en"
vim.opt.foldmethod = "syntax"
vim.opt.foldlevel = 1
vim.opt.foldnestmax = 1
vim.opt.hlsearch = true
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.termguicolors = true
vim.opt.autoread = true
-------------------- Keymaps --------------------
-- Clear hlsearch then enter insert mode
vim.keymap.set("n", "i", ":nohls<CR>i", { silent = true })
-- Save with space
vim.keymap.set("n", "<Space>", ":w<CR>", { silent = true })
-- Window navigation
vim.keymap.set("n", "<C-h>", "<C-W>h")
vim.keymap.set("n", "<C-j>", "<C-W>j")
vim.keymap.set("n", "<C-k>", "<C-W>k")
vim.keymap.set("n", "<C-l>", "<C-W>l")
vim.keymap.set("n", "<C-Left>", "<C-W>h")
vim.keymap.set("n", "<C-Down>", "<C-W>j")
vim.keymap.set("n", "<C-Up>", "<C-W>k")
vim.keymap.set("n", "<C-Right>", "<C-W>l")
-- Tab management
vim.keymap.set("n", "<leader>to", ":tabonly<CR>", { silent = true })
vim.keymap.set("n", "<leader>o", ":only<CR>", { silent = true })
vim.keymap.set("n", "<leader><Tab>", ":tabn<CR>", { silent = true })
vim.keymap.set("n", "<S-Tab>", ":tabp<CR>", { silent = true })
-- Clipboard operations
vim.keymap.set("v", "<leader>y", '"+y')
vim.keymap.set("n", "<leader>Y", '"+yg_')
vim.keymap.set("n", "<leader>y", '"+y')
vim.keymap.set("n", "<leader>yy", '"+yy')
vim.keymap.set("n", "<leader>p", '"+p')
vim.keymap.set("n", "<leader>P", '"+P')
-------------------- Bootstrap lazy.nvim --------------------
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-------------------- Plugins --------------------
require("lazy").setup({
-- Colorscheme
{
"ellisonleao/gruvbox.nvim",
priority = 1000,
config = function()
require("gruvbox").setup({
contrast = "hard",
})
vim.cmd.colorscheme("gruvbox")
end,
},
-- Icons (dependency for nvim-tree and lualine)
{ "nvim-tree/nvim-web-devicons", lazy = true },
-- File tree
{
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ "<F2>", "<cmd>NvimTreeToggle<CR>", desc = "Toggle file tree" },
},
config = function()
require("nvim-tree").setup()
end,
},
-- Comments
{
"numToStr/Comment.nvim",
event = "VeryLazy",
config = function()
require("Comment").setup()
end,
},
-- Fuzzy finder (fzf-lua with ripgrep)
{
"ibhagwan/fzf-lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ "<leader>b", "<cmd>FzfLua buffers<CR>", desc = "Buffers" },
{ "<leader>r", "<cmd>FzfLua live_grep<CR>", desc = "Live grep" },
{ "<leader>f", "<cmd>FzfLua files<CR>", desc = "Find files" },
{ "<leader>g", "<cmd>FzfLua git_files<CR>", desc = "Git files" },
{ "<leader>w", "<cmd>FzfLua grep_cword<CR>", desc = "Grep word under cursor" },
},
config = function()
require("fzf-lua").setup({
files = {
cmd = "rg --files --hidden --glob '!**/.git/*'",
},
grep = {
rg_opts = "--hidden --glob '!**/.git/*' --column --line-number --no-heading --color=always --smart-case",
},
})
end,
},
-- Statusline
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup({
options = { theme = "gruvbox" },
})
end,
},
-- Autopairs
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {},
},
-- Surround
{ "4ree/viml-surround", event = "VeryLazy" },
-- LSP
{
"neovim/nvim-lspconfig",
config = function()
vim.lsp.config("clangd", {})
vim.lsp.config("pyright", {})
vim.lsp.config("rust_analyzer", {})
vim.lsp.config("julials", {})
vim.lsp.enable({ "clangd", "pyright", "rust_analyzer", "julials" })
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local opts = { buffer = args.buf }
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
end,
})
end,
},
-- Completion (coq_nvim)
{
"ms-jpq/coq_nvim",
branch = "coq",
dependencies = {
{ "ms-jpq/coq.artifacts", branch = "artifacts" },
{ "ms-jpq/coq.thirdparty", branch = "3p" },
},
init = function()
vim.g.coq_settings = { auto_start = "shut-up" }
end,
},
-- Quickfix enhancements
{ "kevinhwang91/nvim-bqf", ft = "qf" },
-- Git
{ "tpope/vim-fugitive" },
-- IME support
{
"4ree/vim-ime",
event = "VeryLazy",
opts = {},
},
-- LaTeX
{
"lervag/vimtex",
config = function()
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_compiler_latexmk = {
options = {
"-verbose",
"-file-line-error",
"-synctex=1",
"-interaction=nonstopmode",
"-shell-escape",
"-output-directory=./output",
"-aux-directory=./",
},
}
end,
},
-- Julia
{ "JuliaEditorSupport/julia-vim" },
})

132
nvim/init.vim Normal file
View File

@@ -0,0 +1,132 @@
syntax on
set number
set cursorline
set expandtab tabstop=4 shiftwidth=4 softtabstop=4
set autoindent
set spelllang=vi,en
" Fold
set foldmethod=syntax
set foldlevel=1
set foldnestmax=1
set encoding=utf8
" Search
set hlsearch
nnoremap i :nohls<CR>i
" Plugin
call plug#begin()
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'dense-analysis/ale'
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'lervag/vimtex'
Plug 'JuliaEditorSupport/julia-vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'honza/vim-snippets'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'kevinhwang91/nvim-bqf'
Plug 'morhetz/gruvbox'
Plug 'tpope/vim-fugitive'
Plug 'ynkdir/vim-diff'
Plug '4ree/vim-ime'
call plug#end()
"Color scheme
"colorscheme iceberg
"set background=light
colorscheme gruvbox
let g:gruvbox_contrast_light = 'hard'
"Open NERDTree
map <F2> :NERDTreeToggle<CR>
"Coc.nvim
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ CheckBackSpace() ? "\<TAB>" :
\ coc#refresh()
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackSpace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Comments
let mapleader = ","
" remap save
nnoremap <space> :w<CR>
" moving between windows
nnoremap <C-h> <C-W>h
nnoremap <C-j> <C-W>j
nnoremap <C-k> <C-W>k
nnoremap <C-l> <C-W>l
nnoremap <C-Left> <C-W>h
nnoremap <C-Down> <C-W>j
nnoremap <C-Up> <C-W>k
nnoremap <C-Right> <C-W>l
nnoremap <leader>to :tabonly<CR>
nnoremap <leader>o :only<CR>
nnoremap <leader><tab> :tabn<CR>
nnoremap <S-tab> :tabp<CR>
"set clipboard+=unnamedplus
" " Copy to clipboard
vnoremap <leader>y "+y
nnoremap <leader>Y "+yg_
nnoremap <leader>y "+y
nnoremap <leader>yy "+yy
" " Paste from clipboard
nnoremap <leader>p "+p
nnoremap <leader>P "+P
" FZF key mapping
nnoremap <silent> <Leader>b :Buffers<CR>
nnoremap <silent> <Leader>r :Rg<CR>
nnoremap <silent> <Leader>f :Files<CR>
nnoremap <silent> <Leader>g :GFiles<CR>
nnoremap <silent> <Leader>w :Rg <C-R><C-W><CR>
filetype plugin on
set splitright
set splitbelow
let g:vimtex_view_method= 'zathura'
"Language tool
map <F3> :ALEToggle<CR>
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif

127
nvim/init.vim(server) Normal file
View File

@@ -0,0 +1,127 @@
syntax on
set number
set cursorline
set expandtab tabstop=4 shiftwidth=4 softtabstop=4
set autoindent
set spelllang=vi,en
" Fold
set foldmethod=syntax
set foldlevel=1
set foldnestmax=1
set encoding=utf8
" Search
set hlsearch
nnoremap i :nohls<CR>i
" Plugin
call plug#begin()
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'kevinhwang91/nvim-bqf'
Plug 'morhetz/gruvbox'
Plug 'tpope/vim-fugitive'
Plug 'ynkdir/vim-diff'
call plug#end()
"Color scheme
colorscheme gruvbox
let g:gruvbox_contrast_light = 'hard'
set background=dark
" Comments
let mapleader = ","
"Open NERDTree
:nnoremap <silent> <expr> <F2> g:NERDTree.IsOpen() ? "\:NERDTreeClose<CR>" : bufexists(expand('%')) ? "\:NERDTreeFind<CR>" : "\:NERDTree<CR>"
"Coc.nvim
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ CheckBackSpace() ? "\<TAB>" :
\ coc#refresh()
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#_select_confirm() : coc#refresh()
function! CheckBackSpace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
" remap save
nnoremap <space> :w<CR>
" moving between windows
nnoremap <C-h> <C-W>h
nnoremap <C-j> <C-W>j
nnoremap <C-k> <C-W>k
nnoremap <C-l> <C-W>l
nnoremap <C-Left> <C-W>h
nnoremap <C-Down> <C-W>j
nnoremap <C-Up> <C-W>k
nnoremap <C-Right> <C-W>l
nnoremap <leader>to :tabonly<CR>
nnoremap <leader>o :only<CR>
nnoremap <leader><tab> :tabn<CR>
nnoremap <S-tab> :tabp<CR>
"set clipboard+=unnamedplus
" " Copy to clipboard
vnoremap <leader>y "+y
nnoremap <leader>Y "+yg_
nnoremap <leader>y "+y
nnoremap <leader>yy "+yy
" " Paste from clipboard
nnoremap <leader>p "+p
nnoremap <leader>P "+P
" FZF key mapping
nnoremap <silent> <Leader>b :Buffers<CR>
nnoremap <silent> <Leader>r :Rg<CR>
nnoremap <silent> <Leader>f :Files<CR>
nnoremap <silent> <Leader>g :GFiles<CR>
nnoremap <silent> <Leader>w :Rg <C-R><C-W><CR>
filetype plugin on
set splitright
set splitbelow
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
if &term =~ 'xterm' || &term == 'win32'
" Use DECSCUSR escape sequences
let &t_SI = "\e[5 q" " blink bar
let &t_SR = "\e[3 q" " blink underline
let &t_EI = "\e[1 q" " blink block
let &t_ti ..= "\e[1 q" " blink block
let &t_te ..= "\e[0 q" " default (depends on terminal, normally blink
" block)
endif

227
nvim/latexmk.vim Normal file
View File

@@ -0,0 +1,227 @@
" VimTeX - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email: karl.yngve@gmail.com
"
function! vimtex#compiler#latexmk#init(options) abort " {{{1
return s:compiler.new(a:options)
endfunction
" }}}1
function! vimtex#compiler#latexmk#get_rc_opt(root, opt, type, default) abort " {{{1
"
" Parse option from .latexmkrc.
"
" Arguments:
" root Root of LaTeX project
" opt Name of options
" type 0 if string, 1 if integer, 2 if list
" default Value to return if option not found in latexmkrc file
"
" Output:
" [value, location]
"
" value Option value (integer or string)
" location An integer that indicates where option was found
" -1: not found (default value returned)
" 0: global latexmkrc file
" 1: local latexmkrc file
"
if a:type == 0
let l:pattern = '^\s*\$' . a:opt . '\s*=\s*[''"]\(.\+\)[''"]'
elseif a:type == 1
let l:pattern = '^\s*\$' . a:opt . '\s*=\s*\(\d\+\)'
elseif a:type == 2
let l:pattern = '^\s*@' . a:opt . '\s*=\s*(\(.*\))'
else
throw 'VimTeX: Argument error'
endif
" Candidate files
" - each element is a pair [path_to_file, is_local_rc_file].
let l:files = [
\ [a:root . '/latexmkrc', 1],
\ [a:root . '/.latexmkrc', 1],
\ [fnamemodify('~/.latexmkrc', ':p'), 0],
\ [fnamemodify(
\ !empty($XDG_CONFIG_HOME) ? $XDG_CONFIG_HOME : '~/.config', ':p')
\ . '/latexmk/latexmkrc', 0]
\]
let l:result = [a:default, -1]
for [l:file, l:is_local] in l:files
if filereadable(l:file)
let l:match = matchlist(readfile(l:file), l:pattern)
if len(l:match) > 1
let l:result = [l:match[1], l:is_local]
break
end
endif
endfor
" Parse the list
if a:type == 2 && l:result[1] > -1
let l:array = split(l:result[0], ',')
let l:result[0] = []
for l:x in l:array
let l:x = substitute(l:x, "^'", '', '')
let l:x = substitute(l:x, "'$", '', '')
let l:result[0] += [l:x]
endfor
endif
return l:result
endfunction
" }}}1
let s:compiler = vimtex#compiler#_template#new({
\ 'name' : 'latexmk',
\ 'callback' : 1,
\ 'continuous': 1,
\ 'executable' : 'latexmk',
\ 'options' : [
\ '-verbose',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ '-shell-escape',
\ '-output-directory=./output',
\ '-aux-directory=./',
\ ],
\})
function! s:compiler.__check_requirements() abort dict " {{{1
if !executable(self.executable)
call vimtex#log#warning(self.executable . ' is not executable')
throw 'VimTeX: Requirements not met'
endif
endfunction
" }}}1
function! s:compiler.__init() abort dict " {{{1
" Check if .latexmkrc sets the build_dir - if so this should be respected
let l:out_dir =
\ vimtex#compiler#latexmk#get_rc_opt(self.state.root, 'out_dir', 0, '')[0]
if !empty(l:out_dir)
if !empty(self.build_dir) && (self.build_dir !=# l:out_dir)
call vimtex#log#warning(
\ 'Setting out_dir from latexmkrc overrides build_dir!',
\ 'Changed build_dir from: ' . self.build_dir,
\ 'Changed build_dir to: ' . l:out_dir)
endif
let self.build_dir = l:out_dir
endif
endfunction
" }}}1
function! s:compiler.__build_cmd() abort dict " {{{1
let l:cmd = (has('win32')
\ ? 'set max_print_line=2000 & '
\ : 'max_print_line=2000 ') . self.executable
let l:cmd .= ' ' . join(self.options)
let l:cmd .= ' ' . self.get_engine()
if !empty(self.build_dir)
let l:cmd .= ' -outdir=' . fnameescape(self.build_dir)
endif
if self.continuous
let l:cmd .= ' -pvc -view=none'
if self.callback
for [l:opt, l:val] in [
\ ['compiling_cmd', 'vimtex_compiler_callback_compiling'],
\ ['success_cmd', 'vimtex_compiler_callback_success'],
\ ['failure_cmd', 'vimtex_compiler_callback_failure'],
\]
let l:cmd .= s:wrap_option_appendcmd(l:opt, 'echo ' . l:val)
endfor
endif
endif
return l:cmd . ' ' . vimtex#util#shellescape(self.state.base)
endfunction
" }}}1
function! s:compiler.__pprint_append() abort dict " {{{1
return [
\ ['callback', self.callback],
\ ['continuous', self.continuous],
\ ['executable', self.executable],
\]
endfunction
" }}}1
function! s:compiler.clean(full) abort dict " {{{1
let l:cmd = self.executable . ' ' . (a:full ? '-C ' : '-c ')
if !empty(self.build_dir)
let l:cmd .= printf(' -outdir=%s ', fnameescape(self.build_dir))
endif
let l:cmd .= vimtex#util#shellescape(self.state.base)
call vimtex#jobs#run(l:cmd, {'cwd': self.state.root})
endfunction
" }}}1
function! s:compiler.get_engine() abort dict " {{{1
" Parse tex_program from TeX directive
let l:tex_program_directive = self.state.get_tex_program()
let l:tex_program = l:tex_program_directive
" Parse tex_program from from pdf_mode option in .latexmkrc
let [l:pdf_mode, l:is_local] =
\ vimtex#compiler#latexmk#get_rc_opt(self.state.root, 'pdf_mode', 1, -1)
if l:pdf_mode >= 1 && l:pdf_mode <= 5
let l:tex_program_pdfmode = [
\ 'pdflatex',
\ 'pdfps',
\ 'pdfdvi',
\ 'lualatex',
\ 'xelatex',
\][l:pdf_mode-1]
" Use pdf_mode if there is no TeX directive
if l:tex_program_directive ==# '_'
let l:tex_program = l:tex_program_pdfmode
elseif l:is_local && l:tex_program_directive !=# l:tex_program_pdfmode
" Give warning when there may be a confusing conflict
call vimtex#log#warning(
\ 'Value of pdf_mode from latexmkrc is inconsistent with ' .
\ 'TeX program directive!',
\ 'TeX program: ' . l:tex_program_directive,
\ 'pdf_mode: ' . l:tex_program_pdfmode,
\ 'The value of pdf_mode will be ignored.')
endif
endif
return get(g:vimtex_compiler_latexmk_engines,
\ l:tex_program,
\ g:vimtex_compiler_latexmk_engines._)
endfunction
" }}}1
function! s:wrap_option_appendcmd(name, value) abort " {{{1
" Note: On Linux, we use double quoted perl strings; these interpolate
" variables. One should therefore NOT pass values that contain `$`.
let l:win_cmd_sep = has('nvim') ? '^&' : '&'
let l:common = printf('$%s = ($%s ? $%s', a:name, a:name, a:name)
return has('win32')
\ ? printf(' -e "%s . '' %s '' : '''') . ''%s''"',
\ l:common, l:win_cmd_sep, a:value)
\ : printf(' -e ''%s . " ; " : "") . "%s"''',
\ l:common, a:value)
endfunction
"}}}1

View File

@@ -1,22 +0,0 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"coq.artifacts": { "branch": "artifacts", "commit": "ef5f21d638ccc456cfa5b8d0ab37093cefe48c8b" },
"coq.thirdparty": { "branch": "3p", "commit": "2bd969a2bcd2624f9c260b1000957c7e665e308e" },
"coq_nvim": { "branch": "coq", "commit": "d939a34ceb2b57d2937890337a4aa75eb55e18a8" },
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
"julia-vim": { "branch": "master", "commit": "edd3512748bd07252fa79f3c01b759921192a319" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
"nvim-bqf": { "branch": "main", "commit": "f65fba733268ffcf9c5b8ac381287eca7c223422" },
"nvim-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" },
"nvim-tree.lua": { "branch": "master", "commit": "e11ce83ed9a00f065bf676ae4e6c261c766989ba" },
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
"vim-ime": { "branch": "master", "commit": "79e3b02eb50a57305113550be7ca163b267b5e30" },
"viml-surround": { "branch": "master", "commit": "98358bad347aa2b8a180c2edde84c3bd8a51fdd1" },
"vimtex": { "branch": "master", "commit": "95b93a24740f7b89dd8331326b41bdd1337d79f6" }
}

BIN
nvim/site/vi.utf-8.spl Normal file

Binary file not shown.

View File

@@ -14,7 +14,7 @@ set $mod Mod1
#set $up k
#set $right l
# Your preferred terminal emulator
set $term xfce4-terminal
set $term alacritty
# Your preferred application launcher
# Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on.
@@ -24,7 +24,7 @@ set $menu rofi -show drun
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
set $bg /data/sync/images/wallpapers/0002.png
set $bg /data/sync/images/wallpapers/0002.jpg
set $screenlock 'swaylock -i $bg'
set $images $(xdg-user-dir PICTURES)/$(date +'%s_grim.png')
#
@@ -76,9 +76,8 @@ input "5426:156:Razer_Razer_DeathAdder_V2_X_HyperSpeed" {
}
#exec --no-startup-id /usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh
exec --no-startup-id source ~/.config/fcitx.sh
exec --no-startup-id fcitx5
exec --no-startup-id kwalletd6
exec --no-startup-id fcitx5
#exec --no-startup-id blueman-applet
exec --no-startup-id owncloud
exec --no-startup-id waybar
@@ -145,7 +144,7 @@ bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
#bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
bindsym $mod+Shift+p exec systemctl poweroff
bindsym $mod+Shift+p exec loginctl poweroff
bindsym $mod+Shift+l exec swaymsg exit
#
# Moving around:

View File

@@ -1,5 +0,0 @@
# Set a background image
image=/data/sync/images/wallpapers/0002.png
# Set the scaling mode for the image
scaling=fill

View File

@@ -4,7 +4,7 @@
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/window"],
"modules-center": ["clock"],
"modules-right": ["custom/tiramisu","battery", "network", "bluetooth", "wireplumber", "tray"],
"modules-right": ["custom/tiramisu","battery", "bluetooth", "network", "wireplumber", "tray"],
//"modules-right": ["custom/tiramisu", "bluetooth",network", "wireplumber", "tray"],
// Modules configuration
// "hyprland/workspaces": {
@@ -29,20 +29,19 @@
//"format": "{status}  ",
"format-on": "",
"format-off": "󰂲",
//"format-connected": "{device_alias} 󰂱",
"format-connected": "󰂱",
"format-connected": "{device_alias} 󰂱",
// "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}",
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%",
"on-click": "dbus-launch --exit-with-session blueman-manager"
"on-click": "~/.local/bin/rofi-bluetooth"
//"on-click": "blueman-manager"
},
"network": {
"interface": "wlp0s20f3",
"interface": "wls2",
"format": "{ifname}",
//"format-wifi": "{essid} {icon}",
"format-wifi": "{icon}",
"format-wifi": "{essid} {icon}",
"format-ethernet": "{ipaddr}/{cidr} 󰊗",
"format-disconnected": "", //An empty format will hide the module.
"tooltip-format": "{ifname} via {gwaddr} 󰊗",

View File

@@ -83,6 +83,15 @@ tooltip label{
background: @bg_hover;
color: @content_main;
}
button {
border: none;
border-radius: 0;
}
button:hover {
box-shadow: inherit;
text-shadow: inherit;
background: inherit;
}
#taskbar {
}

View File

@@ -1 +0,0 @@
set selection-clipboard clipboard