Compare commits

...

7 commits

7 changed files with 145 additions and 98 deletions

View file

@ -42,6 +42,11 @@ if.app-id = 'org.mozilla.firefox'
if.window-title-regex-substring = 'Picture-in-Picture' if.window-title-regex-substring = 'Picture-in-Picture'
run = 'layout floating' run = 'layout floating'
[[on-window-detected]]
if.app-id = 'app.zen-browser.zen'
if.window-title-regex-substring = 'Picture-in-Picture'
run = 'layout floating'
[[on-window-detected]] [[on-window-detected]]
if.app-id = 'app.zen-browser.zen' if.app-id = 'app.zen-browser.zen'
if.window-title-regex-substring = 'Bitwarden' if.window-title-regex-substring = 'Bitwarden'

View file

@ -48,3 +48,5 @@ end
# Set up fzf # Set up fzf
set -U FZF_DEFAULT_OPTS "--bind 'bs:backward-delete-char/eof'" set -U FZF_DEFAULT_OPTS "--bind 'bs:backward-delete-char/eof'"
fzf --fish | source fzf --fish | source
starship init fish | source

View file

@ -1,8 +1,61 @@
git: git:
paging: paging:
colorArg: always colorArg: always
pager: delta --dark --paging=never --syntax-theme base16-256 --diff-so-fancy pager: delta --features lazygit
useConfig: false useConfig: false
autoFetch: false autoFetch: false
gui: gui:
nerdFontsVersion: 3 nerdFontsVersion: 3
customCommands:
- key: "C"
command: "git commit -m '{{ .Form.Type }}{{if .Form.Scopes}}({{ .Form.Scopes }}){{end}}: {{ .Form.Description }}'"
description: "commit with commitizen"
context: "files"
prompts:
- type: "menu"
title: "Select the type of change you are committing."
key: "Type"
options:
- name: "Feature"
description: "a new feature"
value: "feat"
- name: "Fix"
description: "a bug fix"
value: "fix"
- name: "Documentation"
description: "Documentation only changes"
value: "docs"
- name: "Styles"
description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"
value: "style"
- name: "Code Refactoring"
description: "A code change that neither fixes a bug nor adds a feature"
value: "refactor"
- name: "Performance Improvements"
description: "A code change that improves performance"
value: "perf"
- name: "Tests"
description: "Adding missing tests or correcting existing tests"
value: "test"
- name: "Builds"
description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)"
value: "build"
- name: "Continuous Integration"
description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)"
value: "ci"
- name: "Chores"
description: "Other changes that don't modify src or test files"
value: "chore"
- name: "Reverts"
description: "Reverts a previous commit"
value: "revert"
- type: "input"
title: "Enter the scope(s) of this change."
key: "Scopes"
- type: "input"
title: "Enter the short description of the change."
key: "Description"
- type: "confirm"
title: "Is the commit message correct?"
body: "{{ .Form.Type }}{{if .Form.Scopes}}({{ .Form.Scopes }}){{end}}: {{ .Form.Description }}"

View file

@ -1,53 +1,41 @@
--Leader -- Set the leader key
vim.g.mapleader = " " vim.g.mapleader = " "
--termguicolors
vim.opt.termguicolors = true -- Appearance
--Relative line numbers vim.opt.termguicolors = true -- Enable 24-bit colors
vim.wo.number = true vim.opt.number = true -- Show line numbers
vim.wo.relativenumber = true vim.opt.relativenumber = true -- Show relative line numbers
--Remove search highlight vim.opt.wrap = false -- Disable line wrapping
vim.opt.hlsearch = false vim.opt.conceallevel = 2 -- Hide Org mode links (assuming you use Org mode)
vim.opt.incsearch = true vim.opt.concealcursor = 'nc' -- Conceal text in normal mode only
vim.opt.smartindent = true vim.opt.signcolumn = "yes" -- Always show the sign column
-- Make searches case insensitive (except when using uppercase) vim.o.laststatus = 1 -- Always show the status line (Note: original had '1', consider '2' for always visible)
vim.opt.smartcase = true vim.o.winborder = nil -- Use default border for floating windows
--Change word definition
vim.opt.iskeyword:append("_") -- Indentation
--Remove Wrap vim.opt.tabstop = 4 -- Number of spaces a tab represents
vim.opt.wrap = false vim.opt.softtabstop = 4 -- Number of spaces a <Tab> in Insert mode equals
--Not let cursor go bellow 10 chars. vim.opt.shiftwidth = 4 -- Number of spaces to use for autoindent
vim.opt.scrolloff = 10 vim.opt.expandtab = true -- Use spaces instead of tabs
--4 space indent vim.opt.smartindent = true -- Smart auto-indenting
vim.opt.tabstop = 4
vim.opt.softtabstop = 4 -- Searching
vim.opt.shiftwidth = 4 vim.opt.hlsearch = false -- Disable highlighting of search matches
vim.opt.expandtab = true vim.opt.incsearch = true -- Show partial matches while typing
--Undo dir
vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" -- Behavior and Navigation
vim.opt.undofile = true vim.opt.iskeyword:append("_") -- Add '_' to the list of keyword characters
--Backup dir vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor when scrolling
vim.opt.backup = true vim.opt.sidescrolloff = 10
vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" vim.opt.smoothscroll = true
--Org mode hide links
vim.opt.conceallevel = 2 -- File Management
vim.opt.concealcursor = 'nc' vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" -- Directory for undo files
--Jupyter notebooks vim.opt.undofile = true -- Save undo history
vim.g.jukit_convert_overwrite_default = 1 vim.opt.backup = true -- Create backup files
vim.g.jukit_convert_open_default = 0 vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" -- Directory for backup files
vim.g.jukit_shell_cmd = 'ipython3' vim.opt.autoread = true -- Automatically reload changed files
vim.g.jukit_terminal = 'nvimterm' vim.opt.swapfile = false -- Disable swap files
vim.g.jukit_show_prompt = 1
vim.g.jukit_pdf_viewer = 'zathura' -- Formatting
vim.g.jukit_mappings = 0 vim.opt.formatoptions:remove("ro") -- Remove 'ro' from formatoptions (assuming you don't want auto-wrapping comments)
--Format Options
vim.opt.formatoptions:remove("ro")
--Sign gutter always on
vim.opt.signcolumn = "yes"
-- sync buffers automatically
vim.opt.autoread = true
-- disable swapfile
vim.opt.swapfile = false
-- disable statusline
vim.o.laststatus = 1
-- border on floating windows
vim.o.winborder = nil

View file

@ -8,18 +8,6 @@ return {
} }
} }
}, },
{
'nvim-java/nvim-java',
ft = "java",
config = function()
require('java').setup()
local lspconfig = require("lspconfig")
local capabilities = require('blink.cmp').get_lsp_capabilities(nil, true)
lspconfig["jdtls"].setup({
capabilities = capabilities,
})
end
},
{ {
"smjonas/inc-rename.nvim", "smjonas/inc-rename.nvim",
opts = { opts = {
@ -31,6 +19,28 @@ return {
event = "VeryLazy", event = "VeryLazy",
opts = {} opts = {}
}, },
{
"ray-x/go.nvim",
dependencies = {
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = function(lp, opts)
require("go").setup(opts)
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
require('go.format').goimports()
end,
group = format_sync_grp,
})
end,
event = { "CmdlineEnter" },
ft = { "go", 'gomod' },
build = ':lua require("go.install").update_all_sync()'
},
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { dependencies = {
@ -50,7 +60,7 @@ return {
local conform = require("conform") local conform = require("conform")
local function jumpWithVirtLineDiags(jumpCount) local function jumpWithVirtLineDiags(jumpCount)
pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags") -- prevent autocmd for repeated jumps pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags")
vim.diagnostic.jump { count = jumpCount } vim.diagnostic.jump { count = jumpCount }
@ -60,7 +70,7 @@ return {
virtual_lines = { current_line = true }, virtual_lines = { current_line = true },
} }
vim.defer_fn(function() -- deferred to not trigger by jump itself vim.defer_fn(function()
vim.api.nvim_create_autocmd("CursorMoved", { vim.api.nvim_create_autocmd("CursorMoved", {
desc = "User(once): Reset diagnostics virtual lines", desc = "User(once): Reset diagnostics virtual lines",
once = true, once = true,

View file

@ -42,38 +42,9 @@ return {
vim.o.foldcolumn = '0' vim.o.foldcolumn = '0'
vim.o.foldlevel = 99 vim.o.foldlevel = 99
vim.o.foldlevelstart = 99 vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.keymap.set('n', 'zR', require('ufo').openAllFolds) vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
require('ufo').setup({ require('ufo').setup()
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = (' %d '):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, 'MoreMsg' })
return newVirtText
end
})
end end
}, },
{ {
@ -90,4 +61,9 @@ return {
require 'colorizer'.setup() require 'colorizer'.setup()
end end
}, },
{
"echasnovski/mini.diff",
opts = {}
}
} }

View file

@ -9,7 +9,7 @@
smudge = git-lfs smudge -- %f smudge = git-lfs smudge -- %f
[core] [core]
autocrlf = input autocrlf = input
pager = delta pager = delta --features git
excludesFile = ~/.gitignore excludesFile = ~/.gitignore
[interactive] [interactive]
diffFilter = delta --color-only diffFilter = delta --color-only
@ -33,3 +33,16 @@
count-lines = "! git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #" count-lines = "! git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #"
[gpg "ssh"] [gpg "ssh"]
allowedSignersFile = ~/.ssh/allowed_signers allowedSignersFile = ~/.ssh/allowed_signers
[delta]
dark = true
line-numbers = true
hyperlinks = true
hyperlinks-file-link-format = "lazygit-edit://{path}:{line}"
true-color = always
[delta "git"]
pager = less
paging = always
[delta "lazygit"]
features = diff-so-fancy
hunk-header-style = omit
paging = never