Skip to content

Commit b8b5ee2

Browse files
committed
update neovim config
1 parent 1ac81cd commit b8b5ee2

File tree

1 file changed

+23
-93
lines changed

1 file changed

+23
-93
lines changed

init.lua

Lines changed: 23 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
vim.g.mapleader = ' '
55
vim.g.maplocalleader = ' '
66

7+
-- Disable editorconfig
8+
-- vim.g.editorconfig = false
9+
710
-- Set to true if you have a Nerd Font installed and selected in the terminal
811
vim.g.have_nerd_font = true
912

@@ -12,10 +15,10 @@ vim.g.have_nerd_font = true
1215
-- NOTE: You can change these options as you wish!
1316
-- For more options, you can see `:help option-list`
1417

18+
vim.opt.wrap = false
19+
1520
-- Make line numbers default
1621
vim.opt.number = true
17-
-- You can also add relative line numbers, to help with jumping.
18-
-- Experiment for yourself to see if you like it!
1922
-- vim.opt.relativenumber = true
2023

2124
-- Enable mouse mode, can be useful for resizing splits for example!
@@ -25,9 +28,6 @@ vim.opt.mouse = 'a'
2528
vim.opt.showmode = false
2629

2730
-- Sync clipboard between OS and Neovim.
28-
-- Schedule the setting after `UiEnter` because it can increase startup-time.
29-
-- Remove this option if you want your OS clipboard to remain independent.
30-
-- See `:help 'clipboard'`
3131
vim.schedule(function()
3232
vim.opt.clipboard = 'unnamedplus'
3333
end)
@@ -144,6 +144,10 @@ vim.opt.rtp:prepend(lazypath)
144144
require('lazy').setup({
145145
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
146146
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
147+
'vim-scripts/Mark--Karkat', -- Highlight words using different colors
148+
'kylelaker/riscv.vim',
149+
'dcharbon/vim-flatbuffers',
150+
'vhda/verilog_systemverilog.vim',
147151

148152
-- NOTE: Plugins can also be added by using a table,
149153
-- with the first argument being the link and the following
@@ -244,19 +248,24 @@ require('lazy').setup({
244248
version = '*',
245249
dependencies = {
246250
'nvim-lua/plenary.nvim',
247-
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
251+
'nvim-tree/nvim-web-devicons',
248252
'MunifTanjim/nui.nvim',
249253
},
250254
cmd = 'Neotree',
251255
keys = {
252-
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
256+
{ '\\', ':Neotree reveal_force_cwd<CR>', desc = 'NeoTree reveal', silent = true },
253257
},
254258
opts = {
259+
sources = { "filesystem", "buffers", "git_status" },
260+
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
255261
filesystem = {
256-
window = {
257-
mappings = {
258-
['\\'] = 'close_window',
259-
},
262+
bind_to_cwd = false,
263+
follow_current_file = { enabled = true },
264+
use_libuv_file_watcher = true,
265+
},
266+
window = {
267+
mappings = {
268+
['\\'] = 'close_window',
260269
},
261270
},
262271
},
@@ -595,49 +604,6 @@ require('lazy').setup({
595604
end,
596605
},
597606

598-
{ -- Autoformat
599-
'stevearc/conform.nvim',
600-
event = { 'BufWritePre' },
601-
cmd = { 'ConformInfo' },
602-
keys = {
603-
{
604-
'<leader>f',
605-
function()
606-
require('conform').format { async = true, lsp_format = 'fallback' }
607-
end,
608-
mode = '',
609-
desc = '[F]ormat buffer',
610-
},
611-
},
612-
opts = {
613-
notify_on_error = false,
614-
format_on_save = function(bufnr)
615-
-- Disable "format_on_save lsp_fallback" for languages that don't
616-
-- have a well standardized coding style. You can add additional
617-
-- languages here or re-enable it for the disabled ones.
618-
local disable_filetypes = { c = true, cpp = true }
619-
local lsp_format_opt
620-
if disable_filetypes[vim.bo[bufnr].filetype] then
621-
lsp_format_opt = 'never'
622-
else
623-
lsp_format_opt = 'fallback'
624-
end
625-
return {
626-
timeout_ms = 500,
627-
lsp_format = lsp_format_opt,
628-
}
629-
end,
630-
formatters_by_ft = {
631-
lua = { 'stylua' },
632-
-- Conform can also run multiple formatters sequentially
633-
-- python = { "isort", "black" },
634-
--
635-
-- You can use 'stop_after_first' to run the first available formatter from the list
636-
-- javascript = { "prettierd", "prettier", stop_after_first = true },
637-
},
638-
},
639-
},
640-
641607
{ -- Autocompletion
642608
'hrsh7th/nvim-cmp',
643609
event = 'InsertEnter',
@@ -693,25 +659,13 @@ require('lazy').setup({
693659
--
694660
-- No, but seriously. Please read `:help ins-completion`, it is really good!
695661
mapping = cmp.mapping.preset.insert {
696-
-- Select the [n]ext item
697-
['<C-n>'] = cmp.mapping.select_next_item(),
698-
-- Select the [p]revious item
699-
['<C-p>'] = cmp.mapping.select_prev_item(),
700-
701662
-- Scroll the documentation window [b]ack / [f]orward
702663
['<C-b>'] = cmp.mapping.scroll_docs(-4),
703664
['<C-f>'] = cmp.mapping.scroll_docs(4),
704665

705-
-- Accept ([y]es) the completion.
706-
-- This will auto-import if your LSP supports it.
707-
-- This will expand snippets if the LSP sent a snippet.
708-
['<C-y>'] = cmp.mapping.confirm { select = true },
709-
710-
-- If you prefer more traditional completion keymaps,
711-
-- you can uncomment the following lines
712-
--['<CR>'] = cmp.mapping.confirm { select = true },
713-
--['<Tab>'] = cmp.mapping.select_next_item(),
714-
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
666+
['<CR>'] = cmp.mapping.confirm { select = true },
667+
['<Tab>'] = cmp.mapping.select_next_item(),
668+
['<S-Tab>'] = cmp.mapping.select_prev_item(),
715669

716670
-- Manually trigger a completion from nvim-cmp.
717671
-- Generally you don't need this, because nvim-cmp will display
@@ -837,29 +791,6 @@ require('lazy').setup({
837791
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
838792
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
839793
},
840-
841-
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
842-
-- init.lua. If you want these files, they are in the repository, so you can just download them and
843-
-- place them in the correct locations.
844-
845-
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
846-
--
847-
-- Here are some example plugins that I've included in the Kickstart repository.
848-
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
849-
--
850-
-- require 'kickstart.plugins.debug',
851-
-- require 'kickstart.plugins.indent_line',
852-
-- require 'kickstart.plugins.lint',
853-
-- require 'kickstart.plugins.autopairs',
854-
-- require 'kickstart.plugins.neo-tree',
855-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
856-
857-
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
858-
-- This is the easiest way to modularize your config.
859-
--
860-
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
861-
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
862-
-- { import = 'custom.plugins' },
863794
}, {
864795
ui = {
865796
-- If you are using a Nerd Font: set icons to an empty table which will use the
@@ -882,5 +813,4 @@ require('lazy').setup({
882813
},
883814
})
884815

885-
-- The line beneath this is called `modeline`. See `:help modeline`
886816
-- vim: ts=2 sts=2 sw=2 et

0 commit comments

Comments
 (0)