Add rust-tools, toggleterm and neovide configs

This commit is contained in:
cool-mist
2024-02-16 15:23:47 +05:30
parent c03658f01d
commit 102d51fb83
2 changed files with 51 additions and 2 deletions
+8
View File
@@ -0,0 +1,8 @@
# .pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: mixed-line-ending
args: [--fix=lf]
+43 -2
View File
@@ -12,7 +12,9 @@ O.shiftwidth=2
O.expandtab=true O.expandtab=true
O.preserveindent=true O.preserveindent=true
O.termguicolors=true O.termguicolors=true
-- If running on WSL + Arch, uncomment this for faster startup -- If running on WSL + Arch, uncomment this for faster startup
-- before setting the clipbard to unnamedplus
-- V.g.clipboard = { -- V.g.clipboard = {
-- name = 'win32yank', -- name = 'win32yank',
-- copy = { -- copy = {
@@ -26,7 +28,8 @@ O.termguicolors=true
-- cache_enabled = 0, -- cache_enabled = 0,
--} --}
O.clipboard='unnamedplus' O.clipboard='unnamedplus'
V.cmd("colorscheme habamax")
V.cmd("colorscheme lunaperche")
-------------------------- --------------------------
---- Config Section ----- ---- Config Section -----
@@ -86,12 +89,16 @@ packer.startup({function(u)
u 'hrsh7th/cmp-path' u 'hrsh7th/cmp-path'
u 'L3MON4D3/LuaSnip' u 'L3MON4D3/LuaSnip'
u 'Sirver/ultisnips' u 'Sirver/ultisnips'
u 'simrat39/rust-tools.nvim'
u 'honza/vim-snippets' u 'honza/vim-snippets'
u { u {
'VonHeikemen/lsp-zero.nvim', 'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x' branch = 'v2.x'
} }
-- Debugging
u 'puremourning/vimspector'
-- Markdown -- Markdown
u 'godlygeek/tabular' u 'godlygeek/tabular'
u 'elzr/vim-json' u 'elzr/vim-json'
@@ -99,6 +106,9 @@ packer.startup({function(u)
u 'vim-pandoc/vim-pandoc-syntax' u 'vim-pandoc/vim-pandoc-syntax'
u 'itchyny/calendar.vim' u 'itchyny/calendar.vim'
-- Terminal
u 'akinsho/toggleterm.nvim'
-- File tree, telescope -- File tree, telescope
u 'nvim-lua/plenary.nvim' u 'nvim-lua/plenary.nvim'
u 'nvim-tree/nvim-web-devicons' u 'nvim-tree/nvim-web-devicons'
@@ -160,7 +170,7 @@ lsp.ensure_installed({
'lua_ls', 'lua_ls',
'tsserver', 'tsserver',
'eslint', 'eslint',
'rust_analyzer' 'rust_analyzer',
}) })
lsp.setup(); lsp.setup();
@@ -199,6 +209,11 @@ lualine.setup({
local whichkey = require('which-key') local whichkey = require('which-key')
whichkey.setup() whichkey.setup()
local toggleterm = require('toggleterm')
toggleterm.setup({
direction = 'float',
})
-- vim-markdown -- vim-markdown
V.cmd('let g:vim_markdown_folding_disabled = 1') V.cmd('let g:vim_markdown_folding_disabled = 1')
V.cmd('let g:vim_markdown_conceal = 0') V.cmd('let g:vim_markdown_conceal = 0')
@@ -220,6 +235,21 @@ V.cmd([[
augroup END augroup END
]]) ]])
--------------------------
---- Config Section -----
--- x --- Neovide --------
--------------------------
if V.g.neovide then
-- V.g.neovide_fullscreen = true
V.g.neovide_cursor_animation_length = 0.05
V.g.neovide_transparency = 0.85
V.g.neovide_refresh_rate_idle = 5
V.g.neovide_cursor_trail_size = 0.2
V.g.neovide_cursor_vfx_mode = "railgun"
end
-------------------------- --------------------------
---- Config Section ----- ---- Config Section -----
--- x --- Keybindings ---- --- x --- Keybindings ----
@@ -263,6 +293,12 @@ keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts) keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts) keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
-- terminal
keymap("t", "<Esc>", "<C-\\><C-n>", opts)
keymap("n", "tt", ":ToggleTerm<CR>", opts)
keymap("x", "tt", ":ToggleTerm<CR>", opts)
-- Notes -- Notes
keymap('n', '<leader>tf', ':TableFormat<cr>', opts) keymap('n', '<leader>tf', ':TableFormat<cr>', opts)
keymap('n', '<leader>tc', ':Toc<cr>', opts) keymap('n', '<leader>tc', ':Toc<cr>', opts)
@@ -273,6 +309,11 @@ keymap('n', '<leader>fy', ':let @+=@%<cr>', opts)
keymap('n', 'gn', 'yi[:e <C-r>*<cr>', opts) keymap('n', 'gn', 'yi[:e <C-r>*<cr>', opts)
keymap('n', 'gm', ':e main.md<cr>', opts) keymap('n', 'gm', ':e main.md<cr>', opts)
-- Neovide
if V.g.neovide then
keymap('n', '<leader>ff', ':lua V.g.neovide_fullscreen = true<cr>', opts)
end
-- Misc -- Misc
keymap('n', '<S-u>', ':red<cr>', opts) keymap('n', '<S-u>', ':red<cr>', opts)
keymap('n', '<leader>;', ':nohl<cr>', opts) keymap('n', '<leader>;', ':nohl<cr>', opts)