This commit is contained in:
Yaser Alraddadi 2024-06-23 10:32:53 +03:00
parent 5aeddfdd5d
commit d30f6da1ae
No known key found for this signature in database
GPG Key ID: 808212144E6DBE90
3 changed files with 207 additions and 6 deletions

View File

@ -227,3 +227,58 @@ sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
```
</details>
```
lua/custom/plugins/markdown.lua
return {
{
"iamcco/markdown-preview.nvim",
ft = "markdown",
build = ":call mkdp#util#install()",
},
}
lua/custom/plugins/others.lua
return {
-- {
-- "kevinhwang91/nvim-bqf",
-- lazy = false,
-- },
{
"tpope/vim-unimpaired",
},
}
lua/custom/plugins/rust.lua
return {
{
"rust-lang/rust.vim",
ft = "rust",
init = function()
vim.g.rustfmt_autosave = 1
end,
},
--{
-- "simrat39/rust-tools.nvim",
-- ft = "rust",
-- dependencies = "neovim/nvim-lspconfig",
-- opts = function()
-- return require "custom.configs.rust-tools"
-- end,
-- config = function(_, opts)
-- require("rust-tools").setup(opts)
-- end,
--},
{
"saecki/crates.nvim",
ft = { "rust", "toml" },
dependencies = { 'nvim-lua/plenary.nvim' },
config = function(_, opts)
local crates = require "crates"
crates.setup(opts)
crates.show()
end,
},
}
```

128
init.lua
View File

@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
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'
@ -119,11 +119,11 @@ vim.opt.clipboard = 'unnamedplus'
vim.opt.breakindent = true
-- Save undo history
vim.opt.undofile = true
-- vim.opt.undofile = true
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- vim.opt.ignorecase = true
-- vim.opt.smartcase = true
-- Keep signcolumn on by default
vim.opt.signcolumn = 'yes'
@ -154,6 +154,45 @@ vim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10
-- Cutom configs
vim.opt.colorcolumn = '100'
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = false
-- https://youtu.be/w7i4amO_zaE?t=1408
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv 'HOME' .. '/.vim/undodir'
vim.opt.undofile = true
-- vim.opt.hlsearch = false
-- vim.opt.incsearch = true
vim.opt.scrolloff = 4
vim.opt.ignorecase = false
vim.opt.smartcase = false
-- vim.opt.colorcolumn = "100"
-- autocmd BufReadPost *.py :SymbolsOutline
-- vim.api.nvim_command('autocmd BufReadPost *.py :SymbolsOutline')
vim.g.undotree_WindowLayout = 3
vim.g.undotree_ShortIndicators = 1
-- spell
-- vim.opt.spelllang = 'en_us'
-- vim.opt.spell = true
-- vim.opt.spellsuggest='best,9'
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
@ -181,6 +220,12 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Disable arrow keys
vim.keymap.set({ 'n', 'i', 'v' }, '<Up>', '<Nop>', { silent = true })
vim.keymap.set({ 'n', 'i', 'v' }, '<Down>', '<Nop>', { silent = true })
vim.keymap.set({ 'n', 'i', 'v' }, '<Left>', '<Nop>', { silent = true })
vim.keymap.set({ 'n', 'i', 'v' }, '<Right>', '<Nop>', { silent = true })
-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
--
@ -592,6 +637,53 @@ require('lazy').setup({
},
},
},
rust_analyzer = {
checkOnSave = {
allFeatures = true,
overrideCommand = {
'cargo',
'clippy',
'--workspace',
'--message-format=json',
'--all-targets',
'--all-features',
},
},
},
ruff_lsp = {
init_options = {
settings = {
-- Any extra CLI arguments for `ruff` go here.
args = {},
},
},
},
-- pylsp = {
-- pylsp = {
-- plugins = {
-- pycodestyle = {
-- ignore = { 'W391' },
-- maxLineLength = 100,
-- },
-- },
-- },
-- },
bashls = {},
cssls = {},
html = {},
jsonls = {},
tailwindcss = {},
tsserver = {},
ltex = {
ltex = {
additionalRules = {
languageModel = '~/ngrams/',
},
},
},
}
-- Ensure the servers and tools above are installed
@ -835,7 +927,31 @@ require('lazy').setup({
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
ensure_installed = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'vim',
'vimdoc',
'python',
'rust',
'tsx',
'typescript',
'javascript',
'css',
'json',
'comment',
'gitignore',
'kdl',
'regex',
'sql',
'toml',
'yaml',
},
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
@ -885,7 +1001,7 @@ require('lazy').setup({
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
}, {
ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the

View File

@ -0,0 +1,30 @@
return {
{
'rust-lang/rust.vim',
ft = 'rust',
init = function()
vim.g.rustfmt_autosave = 1
end,
},
--{
-- "simrat39/rust-tools.nvim",
-- ft = "rust",
-- dependencies = "neovim/nvim-lspconfig",
-- opts = function()
-- return require "custom.configs.rust-tools"
-- end,
-- config = function(_, opts)
-- require("rust-tools").setup(opts)
-- end,
--},
{
'saecki/crates.nvim',
ft = { 'rust', 'toml' },
dependencies = { 'nvim-lua/plenary.nvim' },
config = function(_, opts)
local crates = require 'crates'
crates.setup(opts)
crates.show()
end,
},
}