Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions install_neovim.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/env bash

# Foreground colors
BLACK='\033[0;30m'
RED='\033[1;31m'
GREEN='\033[1;32m'
YELLOW='\033[1;33m'
BLUE='\033[1;34m'
MAGENTA='\033[1;35m'
CYAN='\033[1;36m'
WHITE='\033[1;37m'
NC='\033[0m' # No Color

#Cursor Position control
# \33[2k -> erases the entire line your cursor is currently on
# \r -> brings your cursor to the beginning of the line
RESETLINE="\33[2k\r"

#function for dependency check
dep_ch() {
for dep; do
Expand All @@ -11,12 +27,12 @@ dep_ch() {

# display error message in red to stderr
error() {
printf "\33[2k\r\033[1;31m%s\033[0m\n" "$*" >&2
printf "${RESETLINE} ${RED}%s${NC}\n" "$*" >&2
}

# display an informational message (first argument in green, second in magenta)
# display an informational message (first argument in green, second in yellow, third argument in magenta)
inf() {
printf "\33[2K\r\033[1;35m%s \033[1;35m%s\033[0m\n" "$1" "$2"
printf "$RESETLINE ${GREEN}%s${NC} ${YELLOW}%s${NC} ${MAGENTA}%s${NC}\n" "$1" "$2" "$3"
}

#function to terminate script if error occur
Expand All @@ -28,18 +44,18 @@ terminate_script() {
#provide dependency (space seperated)
dep_ch "gcc" "cmake" || true

CURRENT_DIR=$(pwd)
CURRENT_DIR="$(pwd)"
NEOVIM_DIR="$HOME/.config/nvim/neovim"

#checks if neovim directory already exists
[ ! -d "$NEOVIM_DIR" ] || rm -rf "$NEOVIM_DIR"

# make a choice for build type
inf "" "Please choose a build type"
inf "" "" "Please choose a build type"
PS3='Please enter your choice: '
options=("Nightly" "Release (Default)" "exit script")
select opt in "${options[@]}"; do
case $opt in
case "$opt" in
"Nightly")
BUILD_TYPE="$opt"
break
Expand Down
29 changes: 25 additions & 4 deletions lua/user/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,31 @@ cmp.setup {
name = "copilot",
-- keyword_length = 0,
max_item_count = 3,
-- trigger_characters = {
-- { ".", ":", "(", "'", '"', "[", ",", "#", "*", "@", "|", "=", "-", "{", "/", "\\", "+", "?", " ", "\t", "\n" },
-- },

trigger_characters = {
{
".",
":",
"(",
"'",
'"',
"[",
",",
"#",
"*",
"@",
"|",
"=",
"-",
"{",
"/",
"\\",
"+",
"?",
" ",
"\t",
"\n",
},
},
group_index = 2,
},
{
Expand Down
10 changes: 4 additions & 6 deletions lua/user/comment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ if not status_ok_1 then
end

comment.setup {
ignore = "^$",
pre_hook = function(ctx)
-- For inlay hints
local line_start = (ctx.srow or ctx.range.srow) - 1
local line_end = ctx.erow or ctx.range.erow
require("lsp-inlayhints.core").clear(0, line_start, line_end)

if
vim.bo.filetype == "typescriptreact"
or vim.bo.filetype == "javascriptreact"
or vim.bo.filetype == "javascript"
or vim.bo.filetype == "typescript"
then
require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook()

if vim.bo.filetype == "javascript" or vim.bo.filetype == "typescript" then
local U = require "Comment.utils"

-- Determine whether to use linewise or blockwise commentstring
Expand Down
54 changes: 43 additions & 11 deletions lua/user/illuminate.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,43 @@
-- vim.g.Illuminate_delay = 0
-- vim.g.Illuminate_highlightUnderCursor = 0
vim.g.Illuminate_ftblacklist = { "alpha", "NvimTree", "DressingSelect", "harpoon" }
-- vim.g.Illuminate_highlightUnderCursor = 0
vim.api.nvim_set_keymap("n", "<a-n>", '<cmd>lua require"illuminate".next_reference{wrap=true}<cr>', { noremap = true })
vim.api.nvim_set_keymap(
"n",
"<a-p>",
'<cmd>lua require"illuminate".next_reference{reverse=true,wrap=true}<cr>',
{ noremap = true }
)
-- default configuration
require("illuminate").configure {
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 120,
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"dirvish",
"fugitive",
"alpha",
"NvimTree",
"packer",
"neogitstatus",
"Trouble",
"lir",
"Outline",
"spectre_panel",
"toggleterm",
"DressingSelect",
"TelescopePrompt",
},
-- filetypes_allowlist: filetypes to illuminate, this is overriden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overriden by modes_denylist
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overriden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
}
10 changes: 0 additions & 10 deletions lua/user/lsp/handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ M.setup = function()
})
end

local function lsp_highlight_document(client)
-- if client.server_capabilities.document_highlight then
local status_ok, illuminate = pcall(require, "illuminate")
if not status_ok then
return
end
illuminate.on_attach(client)
-- end
end

local function attach_navic(client, bufnr)
vim.g.navic_silence = true
Expand Down Expand Up @@ -115,7 +106,6 @@ end

M.on_attach = function(client, bufnr)
lsp_keymaps(bufnr)
lsp_highlight_document(client)
attach_navic(client, bufnr)

if client.name == "tsserver" then
Expand Down
3 changes: 2 additions & 1 deletion lua/user/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ run = "./install.sh" }

-- Comment
use "numToStr/Comment.nvim"
use "folke/todo-comments.nvim"
-- use "folke/todo-comments.nvim"
use "B4mbus/todo-comments.nvim"

-- Terminal
use "akinsho/toggleterm.nvim"
Expand Down
9 changes: 8 additions & 1 deletion lua/user/symbol-outline.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
local status_ok, symbols_outline = pcall(require, "symbols-outline")
if not status_ok then
return
end

local icons = require "user.icons"
vim.g.symbols_outline = {
local opts = {
highlight_hovered_item = true,
show_guides = true,
auto_preview = false,
Expand Down Expand Up @@ -48,3 +53,5 @@ vim.g.symbols_outline = {
TypeParameter = { icon = icons.kind.TypeParameter, hl = "CmpItemKindTypeParameter" },
},
}

symbols_outline.setup(opts)
2 changes: 1 addition & 1 deletion lua/user/todo-comments.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ todo_comments.setup {
TODO = { icon = icons.ui.Check, color = hint_blue, alt = { "TIP" } },
HACK = { icon = icons.ui.Fire, color = warning_orange },
WARN = { icon = icons.diagnostics.Warning, color = warning_orange, alt = { "WARNING", "XXX" } },
PERF = { icon = icons.ui.Dashboard, color = perf_purple, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
PERF = { icon = icons.ui.Dashboard, color = perf_purple, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE", "TEST" } },
NOTE = { icon = icons.ui.Note, color = note_green, alt = { "INFO" } },
},
-- merge_keywords = true, -- when true, custom keywords will be merged with the defaults
Expand Down