commit b220d7184e10d47c6b4937d1c813315e752f5eaf
parent 016d641b833836ad3b7a1c5cd5258f9a2fdf3b8b
Author: mehdi-norouzi <mehdeenoroozi@gmail.com>
Date: Mon, 8 Jul 2024 10:23:54 +0330
nvim: minimal config
Diffstat:
19 files changed, 248 insertions(+), 1173 deletions(-)
diff --git a/nvim/.config/nvim/after/plugin/cmp.lua b/nvim/.config/nvim/after/plugin/cmp.lua
@@ -1,46 +0,0 @@
- vim.opt.completeopt = { "menu", "menuone", "noselect" }
-
- -- Set up nvim-cmp.
- local cmp = require'cmp'
-
- cmp.setup({
- snippet = {
- expand = function(args)
- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
- end,
- },
- window = {
- -- completion = cmp.config.window.bordered(),
- -- documentation = cmp.config.window.bordered(),
- },
- mapping = cmp.mapping.preset.insert({
- ["<C-k>"] = cmp.mapping.select_prev_item(),
- ["<C-j>"] = cmp.mapping.select_next_item(),
- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
- ['<C-f>'] = cmp.mapping.scroll_docs(4),
- ['<C-Space>'] = cmp.mapping.complete(),
- ['<C-e>'] = cmp.mapping.abort(),
- ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
- }),
- sources = cmp.config.sources({
- { name = 'nvim_lsp' },
- { name = 'luasnip' }, -- For luasnip users.
- }, {
- { name = 'buffer' },
- { name = 'path' },
- }),
-
- experimental = {
- ghost_test = true,
- },
- })
-
- -- Set configuration for specific filetype.
- cmp.setup.filetype('gitcommit', {
- sources = cmp.config.sources({
- { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
- }, {
- { name = 'buffer' },
- })
- })
-
diff --git a/nvim/.config/nvim/after/plugin/colors.lua b/nvim/.config/nvim/after/plugin/colors.lua
@@ -1,98 +1,15 @@
-vim.g.mehdi_colorscheme = "gruber-darker"
-
---[[ require('rose-pine').setup({
- disable_background = true
-}) ]]
-
--- require('tokyonight').setup({
--- style = "night",
--- transparent = true,
--- terminal_colors = true,
--- dim_inactive = true,
--- on_highlights = function(hl, c)
--- -- local prompt = "2d3149"
--- hl.TelescopeNormal = {
--- bg = c.bg_dark,
--- fg = c.fg_dark,
--- }
--- hl.TelescopeBorder = {
--- bg = c.bg_dark,
--- fg = c.bg_dark,
--- }
--- hl.TelescopePromptNormal = {
--- bg = bg_none,
--- }
--- -- hl.TelescopePromptBorder = {
--- -- bg = prompt,
--- -- fg = prompt,
--- -- }
--- -- hl.TelescopePromptTitle = {
--- -- bg = prompt,
--- -- fg = prompt,
--- -- }
--- hl.TelescopePreviewTitle = {
--- bg = c.bg_dark,
--- fg = c.bg_dark,
--- }
--- hl.TelescopeResultsTitle = {
--- bg = c.bg_dark,
--- fg = c.bg_dark,
--- }
--- end,
--- })
-function ColorMyPencils()
- vim.g.gruvbox_contrast_dark = 'hard'
- vim.g.tokyonight_transparent_sidebar = true
- vim.g.tokyonight_transparent = true
- vim.g.gruvbox_invert_selection = '0'
- vim.opt.background = "dark"
-
- vim.g.gruvbox_material_transparent_background = 1
-
- vim.cmd("colorscheme " .. vim.g.mehdi_colorscheme)
-
- local hl = function(thing, opts)
- vim.api.nvim_set_hl(0, thing, opts)
- end
-
- hl("SignColumn", {
- bg = "none",
- })
-
- hl("ColorColumn", {
- ctermbg = 0,
- bg = "#555555",
- })
-
- hl("CursorLineNR", {
- bg = "None"
- })
-
- hl("Normal", {
- bg = "none"
- })
-
- hl("LineNr", {
- -- fg = "#5eacd3"
- fg = "#b7a6a4"
- })
-
- hl("netrwDir", {
- fg = "#5eacd3"
- })
-
- hl("NormalFloat", {
- bg = "none"
- })
-
- hl("Pmenu", {
- bg = "#415353"
- })
-
- hl("FloatBorder", {
- bg = "none",
- fg = "#ffffff"
- })
+function ColorMyNvim(color)
+ color = color or "rose-pine"
+ vim.cmd.colorscheme(color)
+
+ vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
+ vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
+ vim.api.nvim_set_hl(0, "SignColumn", { bg = "none" })
+ vim.api.nvim_set_hl(0, "LineNr", { fg = "White" })
+ vim.api.nvim_set_hl(0, "StatusLine", { bg = "#334455" })
+ vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#333333" })
+ -- vim.api.nvim_set_hl(0, "FlaotBorder", { bg = "none" })
+
end
-ColorMyPencils()
+ColorMyNvim("gruber-darker")
diff --git a/nvim/.config/nvim/after/plugin/colors.lua.bkp2 b/nvim/.config/nvim/after/plugin/colors.lua.bkp2
@@ -1,145 +0,0 @@
-function ColorMyPencils(color)
- color = color or "gruvbox"
- vim.cmd.colorscheme(color)
- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
-end
-
-ColorMyPencils()
-
--- setup must be called before loading the colorscheme
--- Default options:
---[[ require("gruvbox").setup({
- undercurl = true,
- underline = true,
- bold = true,
- italic = true,
- strikethrough = true,
- invert_selection = false,
- invert_signs = false,
- invert_tabline = false,
- invert_intend_guides = false,
- inverse = true, -- invert background for search, diffs, statuslines and errors
- contrast = 'hard', -- can be "hard", "soft" or empty string
- overrides = {},
- dim_inactive = false,
- transparent_mode = true,
-}) ]]
-
-
---[[ require("tokyonight").setup({
- -- your configuration comes here
- -- or leave it empty to use the default settings
- style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
- transparent = false, -- Enable this to disable setting the background color
- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
- styles = {
- -- Style to be applied to different syntax groups
- -- Value is any valid attr-list value for `:help nvim_set_hl`
- comments = { italic = true },
- keywords = { italic = true },
- functions = {},
- variables = {},
- -- Background styles. Can be "dark", "transparent" or "normal"
- sidebars = "dark", -- style for sidebars, see below
- floats = "dark", -- style for floating windows
- },
- sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
- day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
- hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
- dim_inactive = false, -- dims inactive windows
- lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
-
- --- You can override specific color groups to use other groups or a hex color
- --- function will be called with a ColorScheme table
- ---@param colors ColorScheme
- on_colors = function(colors) end,
-
- --- You can override specific highlights to use other groups or a hex color
- --- function will be called with a Highlights and ColorScheme table
- ---@param highlights Highlights
- ---@param colors ColorScheme
- on_highlights = function(highlights, colors) end,
-})
-
-local latte = require("catppuccin.palettes").get_palette "latte"
-local frappe = require("catppuccin.palettes").get_palette "frappe"
-local macchiato = require("catppuccin.palettes").get_palette "macchiato"
-local mocha = require("catppuccin.palettes").get_palette "mocha" ]]
-
---[[ require("catppuccin").setup({
- transparent_background = true,
- term_colors = false,
- compile = {
- enabled = false,
- path = vim.fn.stdpath("cache") .. "/catppuccin",
- },
- dim_inactive = {
- enabled = false,
- shade = "dark",
- percentage = 0.15,
- },
- styles = {
- comments = { "italic" },
- conditionals = { "italic" },
- loops = {},
- functions = {},
- keywords = {},
- strings = {},
- variables = {},
- numbers = {},
- booleans = {},
- properties = {},
- types = {},
- operators = {},
- },
- integrations = {
- -- For various plugins integrations see https://github.com/catppuccin/nvim#integrations
- },
- color_overrides = {
- Comment = { fg = "#AAAA" },
- },
- highlight_overrides = {},
-}) ]]
-
---[[ require('rose-pine').setup({
- --- @usage 'main' | 'moon'
- dark_variant = 'main',
- bold_vert_split = false,
- dim_nc_background = false,
- disable_background = false,
- disable_float_background = false,
- disable_italics = false,
-
- --- @usage string hex value or named color from rosepinetheme.com/palette
- groups = {
- background = 'base',
- panel = 'surface',
- border = 'highlight_med',
- comment = 'muted',
- link = 'iris',
- punctuation = 'subtle',
-
- error = 'love',
- hint = 'iris',
- info = 'foam',
- warn = 'gold',
-
- headings = {
- h1 = 'iris',
- h2 = 'foam',
- h3 = 'rose',
- h4 = 'gold',
- h5 = 'pine',
- h6 = 'foam',
- }
- -- or set all headings at once
- -- headings = 'subtle'
- },
-
- -- Change specific vim highlight groups
- highlight_groups = {
- ColorColumn = { bg = 'pine' }
- }
-}) ]]
-
diff --git a/nvim/.config/nvim/after/plugin/comment.lua b/nvim/.config/nvim/after/plugin/comment.lua
@@ -1,45 +0,0 @@
-require('Comment').setup({
- ---Add a space b/w comment and the line
- padding = true,
- ---Whether the cursor should stay at its position
- sticky = true,
- ---Lines to be ignored while (un)comment
- ignore = nil,
- ---LHS of toggle mappings in NORMAL mode
- toggler = {
- ---Line-comment toggle keymap
- line = 'gcc',
- ---Block-comment toggle keymap
- block = 'gbc',
- },
- ---LHS of operator-pending mappings in NORMAL and VISUAL mode
- opleader = {
- ---Line-comment keymap
- line = 'gc',
- ---Block-comment keymap
- block = 'gb',
- },
- ---LHS of extra mappings
- extra = {
- ---Add comment on the line above
- above = 'gcO',
- ---Add comment on the line below
- below = 'gco',
- ---Add comment at the end of line
- eol = 'gcA',
- },
- ---Enable keybindings
- ---NOTE: If given `false` then the plugin won't create any mappings
- mappings = {
- ---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
- basic = true,
- ---Extra mapping; `gco`, `gcO`, `gcA`
- extra = true,
- ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}`
- extended = false,
- },
- ---Function to call before (un)comment
- pre_hook = nil,
- ---Function to call after (un)comment
- post_hook = nil,
-})
diff --git a/nvim/.config/nvim/after/plugin/dap.lua b/nvim/.config/nvim/after/plugin/dap.lua
@@ -1,153 +0,0 @@
-local dap_status_ok, dap = pcall(require, "dap")
-if not dap_status_ok then
- return
-end
-
-local dap_ui_status_ok, dapui = pcall(require, "dapui")
-if not dap_ui_status_ok then
- return
-end
-
-local dap_install_status_ok, dap_install = pcall(require, "dap-install")
-if not dap_install_status_ok then
- return
-end
-
-dap_install.setup {}
-
-dap_install.config("python", {})
--- add other configs here
------------------------------------------------------------------------
------------------------------- C cofnig --------------------------------
-dap.adapters.cppdbg = {
- id = 'cppdbg',
- type = 'executable',
- command = '/home/mehdi/.vscode/extensions/ms-vscode.cpptools-1.12.4/debugAdapters/bin/OpenDebugAD7',
- program = function()
- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
- end,
- cwd = '${workspaceFolder}',
- stopAtEntry = true,
-}
-dap.configurations.c = {
- {
- name = "c debug",
- type = "cppdbg",
- request = "launch",
- miDebuggerPath = '/usr/bin/gdb-multiarch',
- program = function()
- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
- end,
- cwd = '${workspaceFolder}',
- stopAtEntry = true,
- },
- {
- name = 'Attach to gdbserver :3333',
- type = 'cppdbg',
- request = 'launch',
- MIMode = 'gdb',
- miDebuggerServerAddress = 'localhost:3333',
- miDebuggerPath = '/usr/bin/arm-none-eabi-gdb',
- cwd = '${workspaceFolder}',
- program = function()
- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file')
- end,
- setupCommands = {
- {
- text = '-enable-pretty-printing',
- description = 'enable pretty printing',
- ignoreFailures = false
- },
- },
- },
-}
------------------------------- C cofnig --------------------------------
-------------------------------------------------------------------------
-
--- dapui.setup {
--- sidebar = {
--- elements = {
--- {
--- id = "scopes",
--- size = 0.25, -- Can be float or integer > 1
--- },
--- { id = "breakpoints", size = 0.25 },
--- },
--- size = 40,
--- position = "right", -- Can be "left", "right", "top", "bottom"
--- },
--- tray = {
--- elements = {},
--- },
--- }
-require("dapui").setup({
- icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" },
- mappings = {
- -- Use a table to apply multiple mappings
- expand = { "<CR>", "<2-LeftMouse>" },
- open = "o",
- remove = "d",
- edit = "e",
- repl = "r",
- toggle = "t",
- },
- -- Expand lines larger than the window
- -- Requires >= 0.7
- expand_lines = vim.fn.has("nvim-0.7"),
- -- Layouts define sections of the screen to place windows.
- -- The position can be "left", "right", "top" or "bottom".
- -- The size specifies the height/width depending on position. It can be an Int
- -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
- -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
- -- Elements are the elements shown in the layout (in order).
- -- Layouts are opened in order so that earlier layouts take priority in window sizing.
- layouts = {
- {
- elements = {
- -- Elements can be strings or table with id and size keys.
- { id = "scopes", size = 0.25 },
- "breakpoints",
- "stacks",
- "watches",
- },
- size = 40, -- 40 columns
- position = "left",
- },
- {
- elements = {
- "repl",
- "console",
- },
- size = 0.25, -- 25% of total lines
- position = "bottom",
- },
- },
- floating = {
- max_height = nil, -- These can be integers or a float between 0 and 1.
- max_width = nil, -- Floats will be treated as percentage of your screen.
- border = "single", -- Border style. Can be "single", "double" or "rounded"
- mappings = {
- close = { "q", "<Esc>" },
- },
- },
- windows = { indent = 1 },
- render = {
- max_type_length = nil, -- Can be integer or nil.
- max_value_lines = 100, -- Can be integer or nil.
- }
-})
-
-vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
-
-dap.listeners.after.event_initialized["dapui_config"] = function()
- dapui.open()
-end
-
-dap.listeners.before.event_terminated["dapui_config"] = function()
- dapui.close()
-end
-
-dap.listeners.before.event_exited["dapui_config"] = function()
- dapui.close()
-end
-
diff --git a/nvim/.config/nvim/after/plugin/file-browser.lua b/nvim/.config/nvim/after/plugin/file-browser.lua
@@ -1,22 +0,0 @@
--- You don't need to set any of these options.
--- IMPORTANT!: this is only a showcase of how you can set default options!
-require("telescope").setup {
- extensions = {
- file_browser = {
- theme = "ivy",
- -- disables netrw and use telescope-file-browser in its place
- hijack_netrw = true,
- mappings = {
- ["i"] = {
- -- your custom insert mode mappings
- },
- ["n"] = {
- -- your custom normal mode mappings
- },
- },
- },
- },
-}
--- To get telescope-file-browser loaded and working with telescope,
--- you need to call load_extension, somewhere after setup function:
--- require("telescope").load_extension "file_browser"
diff --git a/nvim/.config/nvim/after/plugin/harpoon.lua b/nvim/.config/nvim/after/plugin/harpoon.lua
@@ -1,19 +0,0 @@
-global_settings = {
- -- sets the marks upon calling `toggle` on the ui, instead of require `:w`.
- save_on_toggle = false,
-
- -- saves the harpoon file upon every change. disabling is unrecommended.
- save_on_change = true,
-
- -- sets harpoon to run the command immediately as it's passed to the terminal when calling `sendCommand`.
- enter_on_sendcmd = false,
-
- -- closes any tmux windows harpoon that harpoon creates when you close Neovim.
- tmux_autoclose_windows = false,
-
- -- filetypes that you want to prevent from adding to the harpoon list menu.
- excluded_filetypes = { "harpoon" },
-
- -- set marks specific to each git branch inside git repository
- mark_branch = false,
-}
diff --git a/nvim/.config/nvim/after/plugin/lsp.lua b/nvim/.config/nvim/after/plugin/lsp.lua
@@ -1,54 +0,0 @@
--- Learn the keybindings, see :help lsp-zero-keybindings
--- Learn to configure LSP servers, see :help lsp-zero-api-showcase
-local lsp = require('lsp-zero')
-lsp.preset('recommended')
-
-lsp.setup()
-
-
-lsp.ensure_installed({
- -- 'clangd',
- 'lua_ls',
- -- 'rust_analyzer',
-})
-
-
--- Fix Undefined global 'vim'
-lsp.configure('lua_ls', {
- settings = {
- Lua = {
- diagnostics = {
- globals = { 'vim' }
- }
- }
- }
-})
-
-
-lsp.on_attach(function(client, bufnr)
- local opts = {buffer = bufnr, remap = false}
-
- if client.name == "eslint" then
- vim.cmd.LspStop('eslint')
- return
- end
-
- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
- vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
- vim.keymap.set("n", "<leader>vws", vim.lsp.buf.workspace_symbol, opts)
- vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts)
- vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts)
- vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts)
- vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
- vim.keymap.set("n", "<leader>rr", vim.lsp.buf.references, opts)
- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
- vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
- vim.keymap.set("n", "<leader>lf", function() vim.lsp.buf.format { async = true } end, opts)
-end)
-
-lsp.setup()
-
-vim.diagnostic.config({
- virtual_text = true,
-})
-
diff --git a/nvim/.config/nvim/after/plugin/lualine.lua b/nvim/.config/nvim/after/plugin/lualine.lua
@@ -1,45 +0,0 @@
-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,
- globalstatus = false,
- refresh = {
- statusline = 1000,
- tabline = 1000,
- winbar = 1000,
- }
- },
- sections = {
- lualine_a = { 'mode' },
- lualine_b = { 'branch', 'diff', 'diagnostics' },
- lualine_c = {
- {
- 'filename',
- path = 3,
- }
- },
- lualine_x = { 'filetype' },
- lualine_y = {},
- lualine_z = { 'location', 'progress' }
- },
- inactive_sections = {
- lualine_a = {},
- lualine_b = { 'branch' },
- lualine_c = { 'filename' },
- lualine_x = { 'location' },
- lualine_y = {},
- lualine_z = {}
- },
- tabline = {},
- winbar = {},
- inactive_winbar = {},
- extensions = {}
-}
diff --git a/nvim/.config/nvim/after/plugin/oil.lua b/nvim/.config/nvim/after/plugin/oil.lua
@@ -1,177 +1,181 @@
require("oil").setup({
- -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
- -- Set to false if you still want to use netrw.
- default_file_explorer = true,
- -- Id is automatically added at the beginning, and name at the end
- -- See :help oil-columns
- columns = {
- "icon",
- "permissions",
- "size",
- "mtime",
- },
- -- Buffer-local options to use for oil buffers
- buf_options = {
- buflisted = false,
- bufhidden = "hide",
- },
- -- Window-local options to use for oil buffers
- win_options = {
- wrap = false,
- signcolumn = "no",
- cursorcolumn = false,
- foldcolumn = "0",
- spell = false,
- list = false,
- conceallevel = 3,
- concealcursor = "nvic",
- },
- -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
- delete_to_trash = false,
- -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
- skip_confirm_for_simple_edits = true,
- -- Selecting a new/moved/renamed file or directory will prompt you to save changes first
- -- (:help prompt_save_on_select_new_entry)
- prompt_save_on_select_new_entry = true,
- -- Oil will automatically delete hidden buffers after this delay
- -- You can set the delay to false to disable cleanup entirely
- -- Note that the cleanup process only starts when none of the oil buffers are currently displayed
- cleanup_delay_ms = 2000,
- lsp_file_methods = {
- -- Time to wait for LSP file operations to complete before skipping
- timeout_ms = 1000,
- -- Set to true to autosave buffers that are updated with LSP willRenameFiles
- -- Set to "unmodified" to only save unmodified buffers
- autosave_changes = false,
- },
- -- Constrain the cursor to the editable parts of the oil buffer
- -- Set to `false` to disable, or "name" to keep it on the file names
- constrain_cursor = "editable",
- -- Set to true to watch the filesystem for changes and reload oil
- experimental_watch_for_changes = false,
- -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
- -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
- -- Additionally, if it is a string that matches "actions.<name>",
- -- it will use the mapping at require("oil.actions").<name>
- -- Set to `false` to remove a keymap
- -- See :help oil-actions for a list of all available actions
- keymaps = {
- ["g?"] = "actions.show_help",
- ["<CR>"] = "actions.select",
- ["<C-s>"] = "actions.select_vsplit",
- ["<C-h>"] = "actions.select_split",
- ["<C-t>"] = "actions.select_tab",
- ["<C-p>"] = "actions.preview",
- ["<C-c>"] = "actions.close",
- ["<C-l>"] = "actions.refresh",
- ["-"] = "actions.parent",
- ["_"] = "actions.open_cwd",
- ["`"] = "actions.cd",
- ["~"] = "actions.tcd",
- ["gs"] = "actions.change_sort",
- ["gx"] = "actions.open_external",
- ["g."] = "actions.toggle_hidden",
- ["g\\"] = "actions.toggle_trash",
- },
- -- Set to false to disable all of the above keymaps
- use_default_keymaps = true,
- view_options = {
- -- Show files and directories that start with "."
- show_hidden = false,
- -- This function defines what is considered a "hidden" file
- is_hidden_file = function(name, bufnr)
- return vim.startswith(name, ".")
- end,
- -- This function defines what will never be shown, even when `show_hidden` is set
- is_always_hidden = function(name, bufnr)
- return false
- end,
- -- Sort file names in a more intuitive order for humans. Is less performant,
- -- so you may want to set to false if you work with large directories.
- natural_order = true,
- sort = {
- -- sort order can be "asc" or "desc"
- -- see :help oil-columns to see which columns are sortable
- { "type", "asc" },
- { "name", "asc" },
+ -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
+ -- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories.
+ default_file_explorer = true,
+ -- Id is automatically added at the beginning, and name at the end
+ -- See :help oil-columns
+ columns = {
+ "icon",
+ "permissions",
+ "size",
+ "mtime",
},
- },
- -- Extra arguments to pass to SCP when moving/copying files over SSH
- extra_scp_args = {},
- -- EXPERIMENTAL support for performing file operations with git
- git = {
- -- Return true to automatically git add/mv/rm files
- add = function(path)
- return false
- end,
- mv = function(src_path, dest_path)
- return false
- end,
- rm = function(path)
- return false
- end,
- },
- -- Configuration for the floating window in oil.open_float
- float = {
- -- Padding around the floating window
- padding = 2,
- max_width = 0,
- max_height = 0,
- border = "rounded",
- win_options = {
- winblend = 0,
+ -- Buffer-local options to use for oil buffers
+ buf_options = {
+ buflisted = false,
+ bufhidden = "hide",
},
- -- This is the config that will be passed to nvim_open_win.
- -- Change values here to customize the layout
- override = function(conf)
- return conf
- end,
- },
- -- Configuration for the actions floating preview window
- preview = {
- -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
- -- min_width and max_width can be a single value or a list of mixed integer/float types.
- -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
- max_width = 0.9,
- -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
- min_width = { 40, 0.4 },
- -- optionally define an integer/float for the exact width of the preview window
- width = nil,
- -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
- -- min_height and max_height can be a single value or a list of mixed integer/float types.
- -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
- max_height = 0.9,
- -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
- min_height = { 5, 0.1 },
- -- optionally define an integer/float for the exact height of the preview window
- height = nil,
- border = "rounded",
+ -- Window-local options to use for oil buffers
win_options = {
- winblend = 0,
+ wrap = false,
+ signcolumn = "no",
+ cursorcolumn = false,
+ foldcolumn = "0",
+ spell = false,
+ list = false,
+ conceallevel = 3,
+ concealcursor = "nvic",
},
- -- Whether the preview window is automatically updated when the cursor is moved
- update_on_cursor_moved = true,
- },
- -- Configuration for the floating progress window
- progress = {
- max_width = 0.9,
- min_width = { 40, 0.4 },
- width = nil,
- max_height = { 10, 0.9 },
- min_height = { 5, 0.1 },
- height = nil,
- border = "rounded",
- minimized_border = "none",
- win_options = {
- winblend = 0,
+ -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
+ delete_to_trash = false,
+ -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
+ skip_confirm_for_simple_edits = false,
+ -- Selecting a new/moved/renamed file or directory will prompt you to save changes first
+ -- (:help prompt_save_on_select_new_entry)
+ prompt_save_on_select_new_entry = true,
+ -- Oil will automatically delete hidden buffers after this delay
+ -- You can set the delay to false to disable cleanup entirely
+ -- Note that the cleanup process only starts when none of the oil buffers are currently displayed
+ cleanup_delay_ms = 2000,
+ lsp_file_methods = {
+ -- Time to wait for LSP file operations to complete before skipping
+ timeout_ms = 1000,
+ -- Set to true to autosave buffers that are updated with LSP willRenameFiles
+ -- Set to "unmodified" to only save unmodified buffers
+ autosave_changes = false,
+ },
+ -- Constrain the cursor to the editable parts of the oil buffer
+ -- Set to `false` to disable, or "name" to keep it on the file names
+ constrain_cursor = "editable",
+ -- Set to true to watch the filesystem for changes and reload oil
+ watch_for_changes = false,
+ -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
+ -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
+ -- Additionally, if it is a string that matches "actions.<name>",
+ -- it will use the mapping at require("oil.actions").<name>
+ -- Set to `false` to remove a keymap
+ -- See :help oil-actions for a list of all available actions
+ keymaps = {
+ ["g?"] = "actions.show_help",
+ ["<CR>"] = "actions.select",
+ ["<C-s>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" },
+ ["<C-h>"] = { "actions.select", opts = { horizontal = true }, desc = "Open the entry in a horizontal split" },
+ ["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" },
+ ["<C-p>"] = "actions.preview",
+ ["<C-c>"] = "actions.close",
+ ["<C-l>"] = "actions.refresh",
+ ["-"] = "actions.parent",
+ ["_"] = "actions.open_cwd",
+ ["`"] = "actions.cd",
+ ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory" },
+ ["gs"] = "actions.change_sort",
+ ["gx"] = "actions.open_external",
+ ["g."] = "actions.toggle_hidden",
+ ["g\\"] = "actions.toggle_trash",
+ },
+ -- Set to false to disable all of the above keymaps
+ use_default_keymaps = true,
+ view_options = {
+ -- Show files and directories that start with "."
+ show_hidden = false,
+ -- This function defines what is considered a "hidden" file
+ is_hidden_file = function(name, bufnr)
+ return vim.startswith(name, ".")
+ end,
+ -- This function defines what will never be shown, even when `show_hidden` is set
+ is_always_hidden = function(name, bufnr)
+ return false
+ end,
+ -- Sort file names in a more intuitive order for humans. Is less performant,
+ -- so you may want to set to false if you work with large directories.
+ natural_order = true,
+ -- Sort file and directory names case insensitive
+ case_insensitive = false,
+ sort = {
+ -- sort order can be "asc" or "desc"
+ -- see :help oil-columns to see which columns are sortable
+ { "type", "asc" },
+ { "name", "asc" },
+ },
+ },
+ -- Extra arguments to pass to SCP when moving/copying files over SSH
+ extra_scp_args = {},
+ -- EXPERIMENTAL support for performing file operations with git
+ git = {
+ -- Return true to automatically git add/mv/rm files
+ add = function(path)
+ return false
+ end,
+ mv = function(src_path, dest_path)
+ return false
+ end,
+ rm = function(path)
+ return false
+ end,
+ },
+ -- Configuration for the floating window in oil.open_float
+ float = {
+ -- Padding around the floating window
+ padding = 2,
+ max_width = 0,
+ max_height = 0,
+ border = "rounded",
+ win_options = {
+ winblend = 0,
+ },
+ -- preview_split: Split direction: "auto", "left", "right", "above", "below".
+ preview_split = "auto",
+ -- This is the config that will be passed to nvim_open_win.
+ -- Change values here to customize the layout
+ override = function(conf)
+ return conf
+ end,
+ },
+ -- Configuration for the actions floating preview window
+ preview = {
+ -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
+ -- min_width and max_width can be a single value or a list of mixed integer/float types.
+ -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
+ max_width = 0.9,
+ -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
+ min_width = { 40, 0.4 },
+ -- optionally define an integer/float for the exact width of the preview window
+ width = nil,
+ -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
+ -- min_height and max_height can be a single value or a list of mixed integer/float types.
+ -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
+ max_height = 0.9,
+ -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
+ min_height = { 5, 0.1 },
+ -- optionally define an integer/float for the exact height of the preview window
+ height = nil,
+ border = "rounded",
+ win_options = {
+ winblend = 0,
+ },
+ -- Whether the preview window is automatically updated when the cursor is moved
+ update_on_cursor_moved = true,
+ },
+ -- Configuration for the floating progress window
+ progress = {
+ max_width = 0.9,
+ min_width = { 40, 0.4 },
+ width = nil,
+ max_height = { 10, 0.9 },
+ min_height = { 5, 0.1 },
+ height = nil,
+ border = "rounded",
+ minimized_border = "none",
+ win_options = {
+ winblend = 0,
+ },
+ },
+ -- Configuration for the floating SSH window
+ ssh = {
+ border = "rounded",
+ },
+ -- Configuration for the floating keymaps help window
+ keymaps_help = {
+ border = "rounded",
},
- },
- -- Configuration for the floating SSH window
- ssh = {
- border = "rounded",
- },
- -- Configuration for the floating keymaps help window
- keymaps_help = {
- border = "rounded",
- },
})
diff --git a/nvim/.config/nvim/after/plugin/telescope-config.lua b/nvim/.config/nvim/after/plugin/telescope-config.lua
@@ -1,35 +0,0 @@
-require('telescope').setup{
- defaults = {
- -- Default configuration for telescope goes here:
- -- config_key = value,
- mappings = {
- i = {
- -- map actions.which_key to <C-h> (default: <C-/>)
- -- actions.which_key shows the mappings for your picker,
- -- e.g. git_{create, delete, ...}_branch for the git_branches picker
- ["<C-h>"] = "which_key"
- }
- }
- },
- pickers = {
- -- Default configuration for builtin pickers goes here:
- -- picker_name = {
- -- picker_config_key = value,
- -- ...
- -- }
- -- Now the picker_config_key will be applied every time you call this
- -- builtin picker
- },
- extensions = {
- -- Your extension configuration goes here:
- -- extension_name = {
- -- extension_config_key = value,
- -- }
- -- please take a look at the readme of the extension you want to configure
- }
-}
-
-require('telescope').load_extension('fzf')
-require('telescope').load_extension('file_browser')
-require('telescope').load_extension('git_worktree')
--- require('telescope').load_extension('lazygit')
diff --git a/nvim/.config/nvim/after/plugin/telescope.lua b/nvim/.config/nvim/after/plugin/telescope.lua
@@ -0,0 +1,6 @@
+local builtin = require('telescope.builtin')
+vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
+vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
+vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
+vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
+vim.keymap.set('n', '<leader>fw', builtin.git_files, {})
diff --git a/nvim/.config/nvim/after/plugin/toggleterm.lua b/nvim/.config/nvim/after/plugin/toggleterm.lua
@@ -1,39 +0,0 @@
-local status_ok, toggleterm = pcall(require, "toggleterm")
-if not status_ok then
- return
-end
-
-toggleterm.setup({
- size = 80,
- open_mapping = [[<c-\>]],
- hide_numbers = true,
- shade_terminals = true,
- shading_factor = 2,
- start_in_insert = true,
- insert_mappings = true,
- persist_size = true,
- direction = "vertical",
- close_on_exit = true,
- shell = vim.o.shell,
- float_opts = {
- border = "curved",
- },
-})
-
-function _G.set_terminal_keymaps()
- local opts = {noremap = true}
- -- vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
- vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
- vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
- vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
- vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
-end
-
-vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
-
-local Terminal = require("toggleterm.terminal").Terminal
-local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
-
-function _LAZYGIT_TOGGLE()
- lazygit:toggle()
-end
diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua
@@ -1,18 +1,2 @@
-require('mehdi')
--- require('mehdi/packer')
--- require('mehdi/settings')
--- require('mehdi/mappings')
--- require('mehdi/lsp')
--- -- require('mehdi/lsp/settings')
--- require('mehdi/telescope-config')
--- require('mehdi/cmp')
--- require('mehdi/comment')
--- require('mehdi/dap')
--- require('mehdi/treesitter')
--- require('mehdi/colorschemes')
--- require('mehdi/lualine')
--- require('mehdi/toggleterm')
--- require('mehdi/treesitter-context')
--- require('mehdi/harpoon')
--- require('mehdi/gitsigns')
--- require('mehdi/diffview')
+
+require("mehdi")
diff --git a/nvim/.config/nvim/lua/mehdi/init.lua b/nvim/.config/nvim/lua/mehdi/init.lua
@@ -1,3 +1,3 @@
-require('mehdi/settings')
-require('mehdi/mappings')
-require('mehdi/packer')
+require("mehdi.mappings")
+require("mehdi.packer")
+require("mehdi.settings")
diff --git a/nvim/.config/nvim/lua/mehdi/mappings.lua b/nvim/.config/nvim/lua/mehdi/mappings.lua
@@ -1,109 +1,7 @@
vim.g.mapleader = " "
-local map = vim.api.nvim_set_keymap
-local opts = { noremap = true, silent = true }
+vim.keymap.set("n", "-", vim.cmd.Ex)
+vim.keymap.set("i", "jk", "<Esc>")
-map('i', 'jk', '<Esc>', opts)
+vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>")
--- print the date in current buffer
-map("n", "<leader>n", "Go<Esc>:r!echo $(date)<cr>0i## <Esc>o"--[[ :r!echo $(date)<cr>0i## <Esc>o" ]], opts)
-
--- Telescope
-map("n", "<leader>ff", ":Telescope find_files<CR>", opts)
-map("n", "<leader>fF", ":Telescope file_browser<CR>", opts)
-map("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
-map("n", "<leader>fp", ":Telescope projects<CR>", opts)
-map("n", "<leader>fb", ":Telescope buffers<CR><Esc>", opts)
-map("n", "<leader>fs", ":Telescope lsp_document_symbols<CR><Esc>", opts)
-map("n", "<leader>fS", ":Telescope lsp_dynamic_workspace_symbols<CR><Esc>", opts)
-map("n", "<leader>fv", ":Telescope find_files cwd=~/.config/nvim<CR>", opts)
-map("n", "<leader>fn", ":Telescope find_files cwd=~/notes<CR>", opts)
-
--- center in halfpage scroll
-map("n", "<C-d>", "<C-d>zz", opts)
-map("n", "<C-u>", "<C-u>zz", opts)
-
--- copy pasta
-map("x", "<leader>p", '"_dP', opts)
-map("n", "<leader>p", '"*p', opts) -- paste from system clipboard
-map("n", "<leader>y", '"+y', opts) -- copy to system clipboard
-map("v", "<leader>y", '"+y', opts) -- copy to system clipboard
-
--- Undotree
-map("n", "<leader>u", "<cmd>UndotreeToggle<cr>", opts)
-
--- buffers navigation
-map("n", "<leader>x", "<C-w>q", opts)
-map("n", "<leader>j", "<cmd>bn<cr>", opts)
-map("n", "<leader>k", "<cmd>bp<cr>", opts)
-
--- Better window navigation
-map("n", "<C-h>", "<C-w>h", opts)
-map("n", "<C-j>", "<C-w>j", opts)
-map("n", "<C-k>", "<C-w>k", opts)
-map("n", "<C-l>", "<C-w>l", opts)
-
--- Resize with arrows
-map("n", "<C-Up>", ":resize -2<CR>", opts)
-map("n", "<C-Down>", ":resize +2<CR>", opts)
-map("n", "<C-Left>", ":vertical resize -2<CR>", opts)
-map("n", "<C-Right>", ":vertical resize +2<CR>", opts)
-
--- DAP
-map("n", "<leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", opts)
-map("n", "<F5>", "<cmd>lua require'dap'.continue()<cr>", opts)
-map("n", "<F6>", "<cmd>lua require'dap'.step_into()<cr>", opts)
-map("n", "<F7>", "<cmd>lua require'dap'.step_over()<cr>", opts)
-map("n", "<F8>", "<cmd>lua require'dap'.step_out()<cr>", opts)
-map("n", "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", opts)
-map("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts)
-map("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts)
-map("n", "<leader>dt", "<cmd>lua require'dap'.terminate()<cr>", opts)
-
--- toggleterm
-map("n", "<leader>tv", "<cmd>ToggleTerm size=80 direction=vertical<cr>", opts)
-map("n", "<leader>tf", "<cmd>ToggleTerm size=20 direction=float<cr>", opts)
-
--- Lsp restart
-map("n", "<leader>lr", "<cmd>LspRestart<cr>", opts)
--- map('n', 'gv', "<cmd>vs | lua vim.lsp.buf.definition()<CR>", opts)
-
--- harpoon
-map("n", "<leader>ha", "<cmd>lua require('harpoon.mark').add_file()<cr>", opts)
-map("n", "<leader>hl", "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", opts)
-map("n", "<leader>hn", "<cmd>lua require('harpoon.ui').nav_next()<cr>", opts)
-map("n", "<leader>hp", "<cmd>lua require('harpoon.ui').nav_prev()<cr>", opts)
-map("n", "<leader>h1", "<cmd>lua require('harpoon.ui').nav_file(1)<cr>", opts)
-map("n", "<leader>h2", "<cmd>lua require('harpoon.ui').nav_file(2)<cr>", opts)
-map("n", "<leader>h3", "<cmd>lua require('harpoon.ui').nav_file(3)<cr>", opts)
-map("n", "<leader>h4", "<cmd>lua require('harpoon.ui').nav_file(4)<cr>", opts)
-
--- netrw
--- map("n", "<leader>fm", "<cmd><cr>", opts)
-map("n", "-", "<cmd>Oil<cr>", opts)
-
--- building mcu projects
-map("n", "<leader>ma", "<cmd>wa<cr><cmd>! make all -j4<cr>", opts)
-map("n", "<leader>mf", "<cmd>wa<cr><cmd>! make flash-st -j4<cr>", opts)
-map("n", "<leader>mca", "<cmd>wa<cr><cmd>! make clean && make all -j4<cr>", opts)
-map("n", "<leader>m11", "<cmd>wa<cr><cmd>! m11<cr>", opts)
-map("n", "<leader>m12", "<cmd>wa<cr><cmd>! m12<cr>", opts)
-map("n", "<leader>m21", "<cmd>wa<cr><cmd>! m21<cr>", opts)
-map("n", "<leader>m22", "<cmd>wa<cr><cmd>! m22<cr>", opts)
-map("n", "<leader>mf11", "<cmd>wa<cr><cmd>! mf11<cr>", opts)
-map("n", "<leader>mf12", "<cmd>wa<cr><cmd>! mf12<cr>", opts)
-map("n", "<leader>mf21", "<cmd>wa<cr><cmd>! mf21<cr>", opts)
-map("n", "<leader>mf22", "<cmd>wa<cr><cmd>! mf22<cr>", opts)
-
--- doc compiler
-map("n", "<leader>cp", ":wa<cr><cmd>! compiler %<cr><cr>", opts)
-
--- tmux sessionizer
-map("n", "<C-f>", ":sil !tmux neww sessionizer<cr>", opts)
-map("n", "<C-s>", ":sil !tmux split-window -h -l 85 bash -c cht.sh<cr>", opts)
-
--- git worktree
-map("n", "<leader>tl", "<cmd>lua require('telescope').extensions.git_worktree.git_worktrees()<cr>", opts)
-map("n", "<leader>ta", "<cmd>lua require('telescope').extensions.git_worktree.create_git_worktree()<cr>", opts)
-
--- run shell command
-map("n", "<leader>s", ":!", opts)
+vim.keymap.set("n", "-", "<cmd>Oil<CR>")
diff --git a/nvim/.config/nvim/lua/mehdi/packer.lua b/nvim/.config/nvim/lua/mehdi/packer.lua
@@ -1,98 +1,36 @@
-return require('packer').startup(
- function(use)
- -- packer
- use 'wbthomason/packer.nvim'
+vim.cmd [[packadd packer.nvim]]
- -- lsp
- use 'neovim/nvim-lspconfig'
+return require('packer').startup(function(use)
+ -- Packer can manage itself
+ use 'wbthomason/packer.nvim'
+ use {
+ 'nvim-telescope/telescope.nvim', tag = '0.1.8',
+ -- or , branch = '0.1.x',
+ requires = { {'nvim-lua/plenary.nvim'} }
+ }
- -- colorschemes
- use { 'sainnhe/gruvbox-material' }
- use { 'rockerBOO/boo-colorscheme-nvim' }
- use { 'savq/melange-nvim' }
- use { 'fxn/vim-monochrome' }
- use { 'blazkowolf/gruber-darker.nvim' }
- use { 'amedoeyes/eyes.nvim' }
- use { 'phha/zenburn.nvim' }
+ use { "rose-pine/neovim", name = "rose-pine" }
+ use { "blazkowolf/gruber-darker.nvim" }
+ use({
+ "stevearc/oil.nvim",
+ config = function()
+ require("oil").setup()
+ end,
+ })
+ use { 'nvim-tree/nvim-web-devicons' }
- -- telescope
- use {
- 'nvim-telescope/telescope.nvim', tag = '0.1.4',
- requires = { { 'nvim-lua/plenary.nvim' } }
- }
- use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
- use { "nvim-telescope/telescope-file-browser.nvim" }
- use { 'kyazdani42/nvim-web-devicons' }
+ use {'kdheepak/monochrome.nvim'}
- use {
- 'VonHeikemen/lsp-zero.nvim',
- requires = {
- -- LSP Support
- { 'neovim/nvim-lspconfig' },
- { 'williamboman/mason.nvim' },
- { 'williamboman/mason-lspconfig.nvim' },
+ use { 'sainnhe/gruvbox-material' }
+ use { 'slugbyte/lackluster.nvim' }
+ use { "polirritmico/monokai-nightasty.nvim" }
- -- Autocompletion
- { 'hrsh7th/nvim-cmp' },
- { 'hrsh7th/cmp-buffer' },
- { 'hrsh7th/cmp-path' },
- { 'saadparwaiz1/cmp_luasnip' },
- { 'hrsh7th/cmp-nvim-lsp' },
- { 'hrsh7th/cmp-nvim-lua' },
+ use { 'tpope/vim-fugitive' }
- -- Snippets
- { 'L3MON4D3/LuaSnip' },
- -- Snippet Collection (Optional)
- { 'rafamadriz/friendly-snippets' },
- }
- }
- -- comment
- use { 'numToStr/Comment.nvim' }
+end)
- -- undotree
- use { 'mbbill/undotree' }
-
- -- vimwiki
- use { 'vimwiki/vimwiki' }
-
- -- lualine
- use {
- 'nvim-lualine/lualine.nvim',
- requires = { 'kyazdani42/nvim-web-devicons', opt = true }
- }
-
- -- toggleterm
- use { "akinsho/toggleterm.nvim", tag = '*', config = function()
- require("toggleterm").setup()
- end }
-
- -- git stuff
- use { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' }
- use { 'tpope/vim-fugitive' }
- use { 'tpope/vim-unimpaired' }
-
- -- harpoon
- use { "ThePrimeagen/harpoon" }
-
- -- nodev
- use { 'folke/neodev.nvim', opts = {} }
-
- -- git-worktree
- use { 'ThePrimeagen/git-worktree.nvim' }
-
- -- Oil
- use({
- "stevearc/oil.nvim",
- config = function()
- require("oil").setup()
- end,
- })
- -- use { 'stevearc/oil.nvim' }
-
-
- end)
diff --git a/nvim/.config/nvim/lua/mehdi/settings.lua b/nvim/.config/nvim/lua/mehdi/settings.lua
@@ -1,69 +1,29 @@
-local set = vim.opt
+vim.opt.nu = true
+vim.opt.nuw = 1
+vim.opt.relativenumber = true
--- mouse
-set.mouse = 'a'
--- tab and space stuff
-set.expandtab = true
-set.softtabstop = 4
-set.shiftwidth = 4
-set.tabstop = 4
+vim.opt.tabstop = 4
+vim.opt.shiftwidth = 4
+vim.opt.softtabstop = 4
+vim.opt.expandtab = true
--- indentation stuff
-set.smartindent = true
+vim.opt.smartindent = true
+vim.opt.wrap = false
--- search stuff
-set.hlsearch = false
-set.smartcase = true
-set.ignorecase = true
-set.incsearch = true
+vim.opt.swapfile = false
+vim.opt.backup = false
+vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
+vim.opt.undofile = true
--- split stuff
-set.splitbelow = true
-set.splitright = true
-set.scrolloff = 8
-set.fileencoding = 'utf=8'
-set.termguicolors = true
+vim.opt.incsearch = true
+vim.opt.hlsearch = false
+vim.opt.smartcase = true
+vim.opt.ignorecase = true
--- line number stuff
-set.number = true
-set.nuw = 1
-set.relativenumber = true
-set.hidden = true
+vim.opt.termguicolors = true
+vim.opt.signcolumn = "yes"
--- swap and backup stuff
-set.swapfile = false
-set.backup = false
-set.undodir = os.getenv("HOME") .. "/.vim/undodir"
-set.undofile = true
+vim.opt.splitright = true
+vim.opt.splitbelow = true
--- comandline hight
-set.cmdheight = 1
-
--- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
--- delays and poor user experience.
-set.updatetime = 50
-set.signcolumn = "yes"
-
--- netrw
-vim.g.netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
-vim.g.netrw_banner=0
-vim.g.netrw_liststyle=1
-vim.g.netrw_sort_by="exten"
-
--- columns to highlight
--- set.colorcolumn = '100'
-
--- vimwiki markdown syntax
-vim.g.vimwiki_list = {
- {path = '~/notes/vimwiki', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/tech', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/tech/linux', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/tech/rust', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/tech/python', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/tech/embedded', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/ideas', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/science', syntax = 'markdown', ext = '.md'},
- {path = '~/notes/vimwiki/ati', syntax = 'markdown', ext = '.md'},
-}
-
-set.guicursor='n-v-c-:block-blinkwait100-blinkon100-blinkoff80,i-ci-ve:ver25-blinkwait150-blinkon150-blinkoff100,r-ci:hor20'
+vim.opt.guicursor='n-v-c-:block-blinkwait100-blinkon100-blinkoff80,i-ci-ve:ver25-blinkwait150-blinkon150-blinkoff100,r-ci:hor20'
diff --git a/nvim/.config/nvim/shortcuts.vim b/nvim/.config/nvim/shortcuts.vim
@@ -1,29 +0,0 @@
-cmap ;cac /home/mehdi/.cache
-cmap ;cf /home/mehdi/.config
-cmap ;D /home/mehdi/dl
-cmap ;d /home/mehdi/dox
-cmap ;dt /home/mehdi/.local/share
-cmap ;rr /home/mehdi/.local/src
-cmap ;h /home/mehdi
-cmap ;m /home/mehdi/rings
-cmap ;mn /mnt
-cmap ;pp /home/mehdi/pix
-cmap ;sc /home/mehdi/.local/bin
-cmap ;src /home/mehdi/.local/src
-cmap ;vv /home/mehdi/vids
-cmap ;bf /home/mehdi/.config/shell/bm-files
-cmap ;bd /home/mehdi/.config/shell/bm-dirs
-cmap ;cfx /home/mehdi/.config/x11/xresources
-cmap ;cfb ~/.local/src/dwmblocks/config.h
-cmap ;cfv /home/mehdi/.config/nvim/init.vim
-cmap ;cfz /home/mehdi/.config/zsh/.zshrc
-cmap ;cfa /home/mehdi/.config/shell/aliasrc
-cmap ;cfp /home/mehdi/.config/shell/profile
-cmap ;cfm /home/mehdi/.config/mutt/muttrc
-cmap ;cfn /home/mehdi/.config/newsboat/config
-cmap ;cfu /home/mehdi/.config/newsboat/urls
-cmap ;cfmb /home/mehdi/.config/ncmpcpp/bindings
-cmap ;cfmc /home/mehdi/.config/ncmpcpp/config
-cmap ;cfl /home/mehdi/.config/lf/lfrc
-cmap ;cfL /home/mehdi/.config/lf/scope
-cmap ;cfX /home/mehdi/.config/sxiv/exec/key-handler