Compare commits

...

11 Commits

Author SHA1 Message Date
d347569e2f add mapping for obsidian links 2024-11-04 12:14:33 -05:00
64a0f6da0c tree default icons 2024-11-04 09:19:39 -05:00
5ecbea59dc prompt at top 2024-10-29 19:27:51 -04:00
9643ae8259 conceal level 2024-10-17 11:04:42 -04:00
f4f77c3358 include obsidian plugin 2024-10-17 10:11:18 -04:00
0745f9b329 add keymappings 2024-10-17 10:11:00 -04:00
17f45981ed force comment handling for sql 2024-10-16 09:18:14 -04:00
8e0048f55e customer scrolling options and such 2024-10-14 10:33:11 -04:00
80ecc47399 add shortcut key to isolate markdown tasks 2024-10-14 09:09:06 -04:00
Sidhanth Rathod
d0c602f5f1
Merge pull request #50 from algren123/docs/update-nvconfig-reference
docs: updated chadrc.lua reference to nvconfig.lua to point to v3.0
2024-10-05 17:33:03 +05:30
Algren-Michael Pauna
6db16815ac docs: updated chadrc.lua reference to nvconfig.lua to point to v3.0 instead of v2.5 2024-10-05 12:50:23 +01:00
7 changed files with 152 additions and 1 deletions

View File

@ -35,3 +35,13 @@ require "nvchad.autocmds"
vim.schedule(function()
require "mappings"
end)
------added------------
vim.api.nvim_create_autocmd("FileType", {
pattern = "sql",
callback = function()
vim.bo.commentstring = "-- %s"
end,
})
vim.opt.conceallevel = 1 -- or 0, or 2, depending on your preference

View File

@ -1,5 +1,5 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
-- Please read that file to know all available options :(
---@type ChadrcConfig

13
lua/custom_telescope.lua Normal file
View File

@ -0,0 +1,13 @@
local telescope = require('telescope.builtin')
local M = {}
function M.search_markdown_tasks()
telescope.grep_string({
prompt_title = "Open Task List",
search = "- [ ]", -- Customize if needed for specific task markers
cwd = vim.fn.expand('%:p:h') -- Current file's directory
})
end
return M

View File

@ -8,3 +8,49 @@ map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
-- local custom_telescope = require('custom_telescope')
-- Add a keybinding for searching Markdown tasks
vim.api.nvim_set_keymap('n', '<leader>mt', ':lua require("custom_telescope").search_markdown_tasks()<CR>', { noremap = true, silent = true })
-- Add a keybinding for calling ObsidianTag
vim.api.nvim_set_keymap('n', '<leader>tt', ':ObsidianTag<CR>', { noremap = true, silent = true })
-- Add a keybinding for calling ObsidianBacklinks
vim.api.nvim_set_keymap('n', '<leader>lb', ':ObsidianBacklinks<CR>', { noremap = true, silent = true })
-- Add a keybinding for calling ObsidianLink
vim.api.nvim_set_keymap('v', '<leader>fl', ':ObsidianLink<CR>', { noremap = true, silent = true })
-- Configure Telescope to scroll files with ctrl+j/k
local actions = require('telescope.actions')
-- local sorters = require('telescope.sorters')
require('telescope').setup {
defaults = {
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
},
},
}
-- make leader-e toggle the tree view as opposed to just setting focus
vim.api.nvim_set_keymap('n', '<leader>e', ':NvimTreeToggle<CR>', {noremap = true, silent = true})
-- move the whole page without moving the cursor
vim.api.nvim_set_keymap('n', 'J', '<C-e>', { noremap = true })
vim.api.nvim_set_keymap('n', 'K', '<C-y>', { noremap = true })
-- Resize windows
vim.api.nvim_set_keymap('n', '<Up>', '5<C-w>+', { silent = true })
vim.api.nvim_set_keymap('n', '<Down>', '5<C-w>-', { silent = true })
vim.api.nvim_set_keymap('n', '<Right>', '10<C-w>>', { silent = true })
vim.api.nvim_set_keymap('n', '<Left>', '10<C-w><', { silent = true })
-- Set the tab width to 4 spaces
vim.cmd('set tabstop=4')
vim.cmd('set shiftwidth=4')
vim.cmd('set expandtab')
vim.o.hidden = true

View File

@ -4,3 +4,43 @@ require "nvchad.options"
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!
require('telescope').setup{
defaults = {
layout_config = {
prompt_position = "top"
}
}
}
require('nvim-tree').setup{
filters = { dotfiles = false },
disable_netrw = true,
hijack_cursor = true,
sync_root_with_cwd = true,
update_focused_file = {
enable = true,
update_root = false,
},
view = {
width = 30,
preserve_window_proportions = true,
},
renderer = {
root_folder_label = false,
highlight_git = true,
indent_markers = { enable = true },
icons = {
glyphs = {
default = "󰈚",
folder = {
default = "",
empty = "",
empty_open = "",
open = "",
symlink = "",
},
git = { unmerged = "" },
},
},
},
}

View File

@ -13,6 +13,18 @@ return {
end,
},
{
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} },
config = function()
require('telescope').setup {
defaults = {
-- Your default configuration for Telescope (optional)
}
}
end
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {

30
lua/plugins/obsidian.lua Normal file
View File

@ -0,0 +1,30 @@
return {
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- -- refer to `:h file-pattern` for more examples
-- "BufReadPre path/to/my-vault/*.md",
-- "BufNewFile path/to/my-vault/*.md",
-- },
dependencies = {
-- Required.
"nvim-lua/plenary.nvim",
-- see below for full list of optional dependencies 👇
},
opts = {
workspaces = {
{
name = "work",
path = "//mnt/c/Users/ptrowbridge/hc_notes"
},
},
-- see below for full list of options 👇
},
}