Compare commits

..

No commits in common. "59e9fe792332ead28e86053ab8562312b25c9ce8" and "fce7919f7200ece10b15150dfde30c4601cb25c7" have entirely different histories.

7 changed files with 110 additions and 138 deletions

View File

@ -37,7 +37,6 @@ vim.schedule(function()
end)
------added------------
-- SQL-specific settings
vim.api.nvim_create_autocmd("FileType", {
pattern = "sql",
callback = function()
@ -45,8 +44,17 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- pgformatter for SQL files
vim.opt.conceallevel = 1 -- or 0, or 2, depending on your preference
-- pgformatter
vim.api.nvim_create_autocmd("FileType", {
pattern = "sql",
command = "setlocal formatprg=/usr/local/bin/pg_format\\ -",
pattern = "sql",
-- command = "setlocal formatprg=/usr/local/bin/pg_format\\ --comma-start\\ -",
command = "setlocal formatprg=/usr/local/bin/pg_format\\ -",
})
-- set tab spacing
vim.opt.expandtab = true -- Use spaces instead of tabs
vim.opt.shiftwidth = 4 -- Number of spaces for each indentation level
vim.opt.tabstop = 4 -- Number of spaces a tab counts for
vim.opt.softtabstop = 4 -- Number of spaces a tab feels like when editing

View File

@ -1,25 +1,15 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
sql = { "pg_format", "sqlfluff" }, -- pg_format first, fallback to sqlfluff
json = { "jq" },
markdown = { "mdformat" },
-- css = { "prettier" },
-- html = { "prettier" },
},
-- no format_on_save (manual-only)
formatters = {
pg_format = {
prepend_args = {
"--keyword-case", "2", -- 1 = UPPER, 2 = lower
"--function-case", "2", -- 2 = lower
"--spaces", "4",
},
},
sqlfluff = {
args = { "fix", "--force", "--dialect", "postgres", "-" },
},
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
return options

View File

@ -1,43 +0,0 @@
local options = {
filters = {
enable = true,
git_ignored = false,
dotfiles = false,
git_clean = false,
no_buffer = false,
no_bookmark = false,
custom = {},
exclude = {},
},
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 = "" },
},
},
},
}
return options

View File

@ -1,15 +0,0 @@
local actions = require('telescope.actions')
require('telescope').setup {
defaults = {
layout_config = {
prompt_position = "top"
},
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
},
},
}

View File

@ -23,6 +23,21 @@ vim.api.nvim_set_keymap('v', '<leader>fl', ':ObsidianLink<CR>', { noremap = true
vim.api.nvim_set_keymap("n", "<leader>p1", "A 🔼<Esc>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>p2", "A ⏫<Esc>", { 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,
},
},
},
}
-- Live grep all files (including gitignored and hidden files)
vim.keymap.set("n", "<leader>fW", function()
require('telescope.builtin').live_grep({
@ -46,6 +61,13 @@ 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
-- wrap selected text in single quotes
vim.keymap.set('x', "<leader>'", function()
local text = vim.fn.getreg('"') -- Get the visually selected text
@ -57,6 +79,3 @@ vim.keymap.set('x', '<leader>"', function()
local text = vim.fn.getreg('"') -- Get the visually selected text
vim.cmd('normal! c"' .. text .. '"')
end, { desc = "Wrap selected text in double quotes" })
-- Gitsigns blame current line
vim.keymap.set("n", "<leader>gb", ":Gitsigns blame_line<CR>", { noremap = true, silent = true, desc = "Git blame line" })

View File

@ -2,14 +2,55 @@ require "nvchad.options"
-- add yours here!
local opt = vim.opt
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!
require('telescope').setup{
defaults = {
layout_config = {
prompt_position = "top"
}
}
}
-- Tab settings
opt.expandtab = true -- Use spaces instead of tabs
opt.shiftwidth = 4 -- Number of spaces for each indentation level
opt.tabstop = 4 -- Number of spaces a tab counts for
opt.softtabstop = 4 -- Number of spaces a tab feels like when editing
-- Other options
opt.conceallevel = 1 -- Conceal level for markdown, etc.
opt.hidden = true -- Allow hidden buffers
require('nvim-tree').setup{
filters = {
enable = true,
git_ignored = false,
dotfiles = false,
git_clean = false,
no_buffer = false,
no_bookmark = false,
custom = {},
exclude = {},
},
-- 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

@ -1,25 +1,11 @@
return {
-- Conform (formatter)
{
"stevearc/conform.nvim",
lazy = false,
cmd = { "ConformInfo", "ConformFormat" }, -- enables :ConformInfo before load
keys = {
{
"g+w",
function()
require("conform").format({ async = false, lsp_fallback = true })
end,
mode = "n",
desc = "Format file (Conform)",
},
},
config = function()
require("conform").setup(require "configs.conform")
end,
-- event = 'BufWritePre', -- uncomment for format on save
opts = require "configs.conform",
},
-- LSP
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
config = function()
@ -27,28 +13,25 @@ return {
end,
},
-- File explorer
{
"nvim-tree/nvim-tree.lua",
opts = require "configs.nvimtree",
{
'nvim-telescope/telescope.nvim',
requires = { {'nvim-lua/plenary.nvim'} },
config = function()
require('telescope').setup {
defaults = {
-- Your default configuration for Telescope (optional)
}
}
end
},
-- Telescope
{
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require "configs.telescope"
end
},
-- Treesitter
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
require'nvim-treesitter.configs'.setup {
ensure_installed = { "markdown", "sql", "vim", "lua", "vimdoc", "html", "css" },
-- Enable Treesitter syntax highlighting
ensure_installed = { "markdown", "sql","vim",
"lua", "vimdoc", "html", "css" }, -- add other languages if needed
highlight = {
enable = true,
additional_vim_regex_highlighting = { "markdown" },
@ -56,21 +39,10 @@ return {
}
end,
},
-- Transparent
{
'xiyaowong/transparent.nvim',
lazy = false
},
-- Mason (to install formatters like pgformatter/sqlfluff)
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
config = function()
require("mason").setup()
end,
},
'xiyaowong/transparent.nvim',
lazy = false
}
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {