Skip to content
Open

Cleanup #1754

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
269 changes: 240 additions & 29 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--[[


=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
Expand Down Expand Up @@ -102,7 +103,9 @@ vim.g.have_nerd_font = false
vim.o.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true
vim.opt.relativenumber = true
--- MYEDIT
vim.opt.signcolumn = 'number'

-- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a'
Expand Down Expand Up @@ -185,10 +188,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })

-- TIP: Disable arrow keys in normal mode
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')

-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
Expand Down Expand Up @@ -245,6 +248,7 @@ rtp:prepend(lazypath)
-- :Lazy update
--
-- NOTE: Here is where you install your plugins.

require('lazy').setup({
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
Expand Down Expand Up @@ -283,7 +287,119 @@ require('lazy').setup({
},
},
},

-- MY CONFIG
-- {
-- 'iamcco/markdown-preview.nvim',
-- cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
-- ft = { 'markdown' },
-- build = function()
-- vim.fn['mkdp#util#install']()
-- end,
-- },
-- disable netrw at the very start of your init.lua
{
'nvim-tree/nvim-tree.lua',
config = function()
require('nvim-tree').setup {
sort = {
sorter = 'case_sensitive',
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
}
end,
},
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons', 'archibate/lualine-time' },
config = function()
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
-- always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 100,
tabline = 100,
winbar = 100,
},
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = { 'filename' },
lualine_d = { 'lsp_progress' },
-- lualine_w = { 'tabnine' },
-- lualine_x = { 'ctime' },
lualine_y = { 'encoding', 'fileformat', 'filetype' },
lualine_z = { 'location' },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
}
end,
},
{
'numToStr/Comment.nvim',
opts = {
-- add any options here
},
config = function()
require('Comment').setup()
end,
},
{ 'mbbill/undotree' },
{
'christoomey/vim-tmux-navigator',
cmd = {
'TmuxNavigateLeft',
'TmuxNavigateDown',
'TmuxNavigateUp',
'TmuxNavigateRight',
'TmuxNavigatePrevious',
},
keys = {
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
},
},
{
'cuducos/yaml.nvim',
ft = { 'yaml' }, -- optional
dependencies = {
'nvim-treesitter/nvim-treesitter',
'nvim-telescope/telescope.nvim', -- optional
},
},
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
--
-- This is often very useful to both group configuration, as well as handle
Expand All @@ -298,6 +414,8 @@ require('lazy').setup({
-- Then, because we use the `opts` key (recommended), the configuration runs
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.

-- PLUGIN CONFIG

{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
Expand Down Expand Up @@ -357,7 +475,9 @@ require('lazy').setup({
-- you do for a plugin at the top level, you can do for a dependency.
--
-- Use the `dependencies` key to specify the dependencies of a particular plugin

-- changed keymap
--{ vim.keymap.set('n', '<leader><F5>', vim.cmd.UndotreeToggle, { desc = 'Undo tree toggle' }) },
{ vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle, { desc = 'Undo tree toggle' }) },
{ -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
event = 'VimEnter',
Expand Down Expand Up @@ -475,16 +595,18 @@ require('lazy').setup({
},
},
},
{ 'Bilal2453/luvit-meta', lazy = true },
{ 'cespare/vim-toml' },
{
-- Main LSP Configuration
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs and related tools to stdpath for Neovim
-- Mason must be loaded before its dependents so we need to set it up here.
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
{ 'mason-org/mason.nvim', opts = {} },
'mason-org/mason-lspconfig.nvim',
{ 'williamboman/mason.nvim', opts = { ensure_installed = { 'ansible-lint' } }, config = true },
-- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
-- ADDED TO SUPPORT TOML

-- Useful status updates for LSP.
{ 'j-hui/fidget.nvim', opts = {} },
Expand Down Expand Up @@ -626,6 +748,14 @@ require('lazy').setup({
end,
})

-- Change diagnostic symbols in the sign column (gutter)
if vim.g.have_nerd_font then
local signs = { Error = '', Warn = '', Hint = '', Info = '' }
for type, icon in pairs(signs) do
local hl = 'DiagnosticSign' .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
end
-- Diagnostic Config
-- See :help vim.diagnostic.Opts
vim.diagnostic.config {
Expand Down Expand Up @@ -654,7 +784,6 @@ require('lazy').setup({
end,
},
}

-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
Expand All @@ -673,7 +802,8 @@ require('lazy').setup({
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
pyright = {},
ansiblels = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
Expand Down Expand Up @@ -769,14 +899,31 @@ require('lazy').setup({
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
python = { 'isort', 'black' },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
},
},
},

--TABNINE
{
'codota/tabnine-nvim',
build = './dl_binaries.sh',
config = function()
require('tabnine').setup {
disable_auto_comment = true,
accept_keymap = '<Tab>',
dismiss_keymap = '<C-]>',
debounce_ms = 800,
suggestion_color = { gui = '#808080', cterm = 244 },
exclude_filetypes = { 'TelescopePrompt', 'NvimTree' },
log_file_path = nil, -- absolute path to Tabnine log file
ignore_certificate_errors = false,
}
require('tabnine.status').status()
end,
},
{ -- Autocompletion
'saghen/blink.cmp',
event = 'VimEnter',
Expand Down Expand Up @@ -826,16 +973,50 @@ require('lazy').setup({
-- you will need to read `:help ins-completion`
--
-- No, but seriously. Please read `:help ins-completion`, it is really good!
--
-- All presets have the following mappings:
-- <tab>/<s-tab>: move to right/left of your snippet expansion
-- <c-space>: Open menu or open docs if already open
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item
-- <c-e>: Hide menu
-- <c-k>: Toggle signature help
--
-- See :h blink-cmp-config-keymap for defining your own keymap
preset = 'default',
mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),

-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),

-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
--['<C-y>'] = cmp.mapping.confirm { select = true },

-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(),

-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete {},

-- Think of <c-l> as moving to the right of your snippet expansion.
-- So if you have a snippet that's like:
-- function $name($args)
-- $body
-- end
--
-- <c-l> will move you to the right of each of the expansion locations.
-- <c-h> is similar, except moving you backwards.
['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),

-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
Expand Down Expand Up @@ -894,7 +1075,11 @@ require('lazy').setup({
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
--vim.cmd.colorscheme 'tokyonight-night'
vim.cmd.colorscheme 'tokyonight-storm'

-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
end,
},

Expand Down Expand Up @@ -944,7 +1129,26 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
ensure_installed = {
'regex',
'diff',
'yaml',
'toml',
'python',
'sql',
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'java',
},
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
Expand Down Expand Up @@ -978,8 +1182,7 @@ require('lazy').setup({
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps

require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.
--
Expand Down Expand Up @@ -1012,5 +1215,13 @@ require('lazy').setup({
},
})

-- transparencyv
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

-- optionally enable 24-bit colour
vim.opt.termguicolors = true
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
Loading