Skip to content

Commit

Permalink
misc: Add some configs changed over time
Browse files Browse the repository at this point in the history
  • Loading branch information
Granddave committed Oct 4, 2024
1 parent 26ed4ca commit a329054
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 18 deletions.
4 changes: 2 additions & 2 deletions nvim/.config/nvim/after/ftplugin/markdown.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.colorcolumn = "100"
2 changes: 1 addition & 1 deletion nvim/.config/nvim/lua/custom/general.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ vim.opt.smartindent = true
vim.opt.wrap = true -- Wrap words visually
vim.opt.linebreak = true -- Don't split words in a word wrap

vim.opt.relativenumber = true
vim.opt.relativenumber = false
vim.opt.number = true -- Show line numbers
vim.opt.numberwidth = 5 -- Width of numberline
vim.opt.signcolumn = "yes"
Expand Down
2 changes: 1 addition & 1 deletion nvim/.config/nvim/lua/custom/lazy/copilot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ return {
},
},
filetypes = {
yaml = false,
yaml = true,
markdown = false,
txt = false,
help = false,
Expand Down
6 changes: 6 additions & 0 deletions nvim/.config/nvim/lua/custom/lazy/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ return {
"lewis6991/gitsigns.nvim",
opts = {
numhl = true,
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 100,
},
on_attach = function(bufnr)
_ = bufnr
-- TODO: Add range based staging and reset
Expand Down
7 changes: 6 additions & 1 deletion nvim/.config/nvim/lua/custom/lazy/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ local on_attach = function(client, bufnr)
if client.name == "clangd" then
vim.keymap.set("n", "<M-o>", [[<Cmd>ClangdSwitchSourceHeader<CR>]], bufopts)
end
if client.name == "gopls" then

local impl_test_file_toggle = function()
vim.keymap.set("n", "<M-o>", function()
local current_file = vim.fn.expand("%:p")
local base_name = vim.fn.expand("%:t:r")
Expand All @@ -111,6 +112,10 @@ local on_attach = function(client, bufnr)
end
end, bufopts)
end
-- Enable for clients including "gopls", "jedi_language_server" and "pyright"
if vim.tbl_contains({ "gopls", "jedi_language_server", "pyright" }, client.name) then
impl_test_file_toggle()
end
if vim.tbl_contains({ "gopls", "rust_analyzer" }, client.name) then
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
Expand Down
32 changes: 20 additions & 12 deletions nvim/.config/nvim/lua/custom/lazy/obsidian.lua
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
return {
"epwalsh/obsidian.nvim",
-- version = "*",
version = "v2.5.0",
version = "*",
-- version = "v2.5.0",
lazy = true,
ft = "markdown",
dependencies = {
"nvim-lua/plenary.nvim",
},
keys = {
{"gd", "<Cmd>ObsidianFollowLink<CR>", desc = "Follow link"},
{"<Leader>ob", "<Cmd>ObsidianBacklinks<CR>", desc = "Show backlinks"},
{"<Leader>od", "<Cmd>ObsidianToday<CR>", desc = "Go to today's file"},
{ "gd", "<Cmd>ObsidianFollowLink<CR>", desc = "Follow link" },
{ "<Leader>ob", "<Cmd>ObsidianBacklinks<CR>", desc = "Show backlinks" },
{ "<Leader>od", "<Cmd>ObsidianToday<CR>", desc = "Go to today's file" },
{ "<Leader>ot", "<Cmd>ObsidianTemplate<CR>", desc = "Insert template" },
},
opts = {
workspaces = {
{
name = "life",
path = "~/sync/Life",
name = "Notes",
path = "/mnt/c/Users/H973963/OneDrive - Husqvarna Group/Documents/Notes",
},
},

daily_notes = {
folder = "Daily",
-- folder = "Daily",
date_format = "%Y-%m-%d"
},

templates = {
subdir = "Templates",
date_format = "%Y-%m-%d-%a",
time_format = "%H:%M",
},

completion = {
nvim_cmp = true,
min_chars = 2,
-- Where to put new notes created from completion. Valid options are
-- * "current_dir" - put new notes in same directory as the current buffer.
-- * "notes_subdir" - put new notes in the default notes subdirectory.
new_notes_location = "current_dir"
},

-- Where to put new notes created from completion. Valid options are
-- * "current_dir" - put new notes in same directory as the current buffer.
-- * "notes_subdir" - put new notes in the default notes subdirectory.
new_notes_location = "current_dir",

-- Disable the default mappings
mappings = {},
ui = {
Expand Down
3 changes: 3 additions & 0 deletions nvim/.config/nvim/lua/custom/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ map("x", "Q", ":norm @q<CR>", opts)
-- Wrap the selected text with []() and paste the text from the system clipboard
-- inside the parentheses
map("x", "<S-k>", [[<Right>:s/\%V\(.\+\)\%V/[&]()<CR>f("+p]], opts)

-- Toggle treesitter context
map("n", "<Leader>ct", "<Cmd>TSContextToggle<CR>", opts)
3 changes: 2 additions & 1 deletion setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
become: true
apt:
pkg: "{{ apt_packages.gui }}"
when: has_gtk
when: has_gtk or not wsl

- name: Install CLI packages
tags: apt
Expand Down Expand Up @@ -99,6 +99,7 @@
cmd: "stow --verbose {{ item }}"
register: stow_out
changed_when: 'stow_out.stderr is search("LINK: ")'
when: not in_wsl
with_items:
- alacritty
- bin
Expand Down
2 changes: 2 additions & 0 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ setopt HIST_IGNORE_SPACE

plugins=(
command-not-found
direnv
git
zsh-autosuggestions
zsh-syntax-highlighting
Expand Down Expand Up @@ -60,6 +61,7 @@ open()
note()
{
mkdir -p "$NOTE_DIR"
cd "$NOTE_DIR"
local note_file="$NOTE_DIR/$(date '+%F').md"
if ! [ -f "$note_file" ]; then
echo "# $(date '+%F')\n" > "$note_file"
Expand Down

0 comments on commit a329054

Please sign in to comment.