Skip to content
Closed

blybly #1855

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
121 changes: 82 additions & 39 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ I hope you enjoy your Neovim journey,

P.S. You can delete this when you're done too. It's your config now! :)
--]]
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = false

-- Set <space> as the leader key
-- See `:help mapleader`
Expand All @@ -91,18 +95,19 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true

-- [[ Setting options ]]
-- See `:help vim.opt`
-- NOTE: You can change these options as you wish!
-- For more options, you can see `:help option-list`
vim.o.termguicolors = true

-- Make line numbers default
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
vim.opt.relativenumber = true

-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
Expand Down Expand Up @@ -164,6 +169,11 @@ vim.opt.confirm = true
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`

-- OIL NVIM
vim.keymap.set('n', '<leader>e', '<cmd>Oil<CR>', { desc = 'Open file explorer' })

vim.keymap.set('n', '-', '<cmd>Oil<CR>', { desc = 'Open file explorer' })

-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
Expand All @@ -179,11 +189,14 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
-- or just use <C-\><C-n> to exit terminal mode
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })

vim.keymap.set('n', '[c', function()
require('treesitter-context').go_to_context(vim.v.count1)
end, { silent = true, desc = 'Jump to top of current function' })
-- 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 @@ -664,7 +677,13 @@ require('lazy').setup({
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
-- clangd = {},
-- gopls = {},
gopls = {
settings = {
format = {
indent = 'tab',
},
},
},
-- pyright = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
Expand All @@ -673,7 +692,15 @@ require('lazy').setup({
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {},
ts_ls = {
settings = {
format = {
convertTabsToSpaces = false, -- Use tabs instead of spaces
tabSize = 4, -- Width of a tab character
indentSize = 4,
},
},
},
--

lua_ls = {
Expand Down Expand Up @@ -713,7 +740,7 @@ require('lazy').setup({

require('mason-lspconfig').setup {
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
automatic_installation = false,
automatic_installation = true,
handlers = {
function(server_name)
local server = servers[server_name] or {}
Expand Down Expand Up @@ -828,6 +855,11 @@ require('lazy').setup({
--
-- See :h blink-cmp-config-keymap for defining your own keymap
preset = 'default',
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },

['<CR>'] = { 'accept', 'fallback' },
['<Tab>'] = { 'select_next', 'fallback' },
['<S-Tab>'] = { 'select_prev', 'fallback' },

-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
Expand All @@ -842,12 +874,18 @@ require('lazy').setup({
completion = {
-- By default, you may press `<c-space>` to show the documentation.
-- Optionally, set `auto_show = true` to show the documentation after a delay.
documentation = { auto_show = false, auto_show_delay_ms = 500 },
documentation = { auto_show = true, auto_show_delay_ms = 500 },
},

sources = {
default = { 'lsp', 'path', 'snippets', 'lazydev' },
default = { 'lsp', 'path', 'snippets', 'lazydev', 'copilot' },
providers = {
copilot = {
name = 'copilot',
module = 'blink-cmp-copilot',
score_offset = 100,
async = true,
},
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
},
},
Expand All @@ -865,30 +903,34 @@ require('lazy').setup({

-- Shows a signature help window while you type arguments for a function
signature = { enabled = true },

cmdline = {
enabled = false,
},
},
},

{ -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins.
config = function()
---@diagnostic disable-next-line: missing-fields
require('tokyonight').setup {
styles = {
comments = { italic = false }, -- Disable italics in comments
},
}

-- 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'
end,
},
-- { -- You can easily change to a different colorscheme.
-- -- Change the name of the colorscheme plugin below, and then
-- -- change the command in the config to whatever the name of that colorscheme is.
-- --
-- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
-- 'folke/tokyonight.nvim',
-- priority = 1000, -- Make sure to load this before all the other start plugins.
-- config = function()
-- ---@diagnostic disable-next-line: missing-fields
-- require('tokyonight').setup {
-- styles = {
-- comments = { italic = false }, -- Disable italics in comments
-- },
-- }
--
-- -- 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'
-- end,
-- },

-- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
Expand Down Expand Up @@ -965,18 +1007,18 @@ require('lazy').setup({
-- Here are some example plugins that I've included in the Kickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
require 'kickstart.plugins.debug',
require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.lint',
require 'kickstart.plugins.autopairs',
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.
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
require 'custom.plugins.init',
--
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!
Expand Down Expand Up @@ -1004,5 +1046,6 @@ require('lazy').setup({
},
})

vim.api.nvim_set_hl(0, 'BlinkCmpKindCopilot', { fg = '#6CC644' })
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
8 changes: 8 additions & 0 deletions lua/custom/plugins/blink-compat.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
return {
{
'saghen/blink.compat',
version = '*',
lazy = true,
opts = {},
},
}
3 changes: 3 additions & 0 deletions lua/custom/plugins/copilot-cmp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
return {
'giuxtaposition/blink-cmp-copilot',
}
23 changes: 23 additions & 0 deletions lua/custom/plugins/copilot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
return {
'zbirenbaum/copilot.lua',
requires = {
'giuxtaposition/blink-cmp-copilot',
init = function()
vim.g.copilot_nes_debounce = 500
end,
},
cmd = 'Copilot',
event = 'InsertEnter',
config = function()
require('copilot').setup {
-- nes = {
-- enabled = true,
-- keymap = {
-- accept_and_goto = '<leader>p',
-- accept = false,
-- dismiss = '<Esc>',
-- },
-- },
}
end,
}
7 changes: 7 additions & 0 deletions lua/custom/plugins/crates.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
'saecki/crates.nvim',
tag = 'stable',
config = function()
require('crates').setup()
end,
}
6 changes: 6 additions & 0 deletions lua/custom/plugins/hardtime.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
-- 'm4xshen/hardtime.nvim',
-- lazy = false,
-- dependencies = { 'MunifTanjim/nui.nvim' },
-- opts = {},
}
10 changes: 10 additions & 0 deletions lua/custom/plugins/leap.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
'ggandor/leap.nvim',
init = function()
require('leap').add_default_mappings()
end,
dependencies = {
'tpope/vim-repeat',
},
lazy = false,
}
7 changes: 7 additions & 0 deletions lua/custom/plugins/markview.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
'OXY2DEV/markview.nvim',
lazy = false,

-- Completion for `blink.cmp`
dependencies = { 'saghen/blink.cmp' },
}
14 changes: 14 additions & 0 deletions lua/custom/plugins/mason-nvim-dap.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return {
'jay-babu/mason-nvim-dap.nvim',
dependencies = {
'williamboman/mason.nvim',
'mfussenegger/nvim-dap',
},
config = function()
require('mason-nvim-dap').setup {
ensure_installed = { 'codelldb' },
automatic_installation = true,
handlers = {},
}
end,
}
10 changes: 10 additions & 0 deletions lua/custom/plugins/oil.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
'stevearc/oil.nvim',
---@module 'oil'
---@type oil.SetupOpts
opts = {},
-- Optional dependencies
dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if you prefer nvim-web-devicons
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
lazy = false,
}
17 changes: 17 additions & 0 deletions lua/custom/plugins/snipe.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
return {
'leath-dub/snipe.nvim',
keys = {
{
'gb',
function()
require('snipe').open_buffer_menu()
end,
desc = 'Open Snipe buffer menu',
},
},
opts = {
ui = {
position = 'center',
},
},
}
6 changes: 6 additions & 0 deletions lua/custom/plugins/store.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
'alex-popov-tech/store.nvim',
dependencies = { 'OXY2DEV/markview.nvim' },
opts = {},
cmd = 'Store',
}
5 changes: 5 additions & 0 deletions lua/custom/plugins/tscontext.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
return {
'nvim-treesitter/nvim-treesitter-context',
opts = { mode = 'cursor', max_lines = 3 },
dependencies = { 'nvim-treesitter/nvim-treesitter' },
}
6 changes: 6 additions & 0 deletions lua/custom/plugins/typst.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
'chomosuke/typst-preview.nvim',
lazy = false, -- or ft = 'typst'
version = '1.*',
opts = {}, -- lazy.nvim will implicitly calls `setup {}`
}
12 changes: 12 additions & 0 deletions lua/custom/plugins/vague.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
'vague2k/vague.nvim',
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other plugins
config = function()
-- NOTE: you do not need to call setup if you don't want to.
require('vague').setup {
-- optional configuration here
}
vim.cmd 'colorscheme vague'
end,
}
4 changes: 4 additions & 0 deletions lua/custom/plugins/vimbegood.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return {
'ThePrimeagen/vim-be-good',
event = 'VeryLazy',
}
Loading