1
0
Fork 0

neovim: stash changes before hard reset

This commit is contained in:
Pratham Patel 2023-02-07 21:14:00 +05:30
parent 38c03be3f4
commit 012ac14dce
3 changed files with 157 additions and 7 deletions

View File

@ -42,9 +42,12 @@ Plug 'simrat39/rust-tools.nvim'
Plug 'tpope/vim-fugitive'
" src tree view
Plug 'preservim/nerdtree'
Plug 'nvim-tree/nvim-tree.lua'
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
call plug#end()
" lua require("setup"
luafile ~/.config/nvim/lua/setup.lua
" ==============================================================================
@ -53,6 +56,7 @@ call plug#end()
" dealing with files
syntax on
filetype plugin indent on
set paste
set colorcolumn=80
set autoindent expandtab tabstop=4 shiftwidth=4
set encoding=utf-8
@ -232,12 +236,10 @@ nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"enable nerdtree with ^\
map <C-Bslash> :NERDTreeToggle<CR>
" enable clipboard access for Neovide
nnoremap <D-V> "+p
nnoremap <C-S-V> "+p
" neovide (GUI) clipboard
nnoremap <C-S-V> "+P
" handle Ctrl+Shift+V in GUI somehow
" inoremap <C-S-V> "+P
" RUST

View File

@ -0,0 +1,81 @@
--------------------------------------------------------------------------------
-- initial setup
--------------------------------------------------------------------------------
-- disable netrw at the very start of init.lua (strongly advised by _nvim-tree.lua_)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
--------------------------------------------------------------------------------
-- Plugin setup
--------------------------------------------------------------------------------
-- ensure that packer is installed
if vim.fn.empty(vim.fn.glob(vim.fn.stdpath("data").."/site/pack/packer/start/packer.nvim")) > 0 then
PACKER_BOOTSTRAP = vim.fn.system({
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
"~/.local/share/nvim/site/pack/packer/start/packer.nvim",
})
print("Packer installed. Please close and re-open Neovim.");
end
-- Autocommand that reloads Neovim whenever the "plugins.lua" file is saved
-- 'nvim-tree.lua' setup
require("nvim-tree").setup({
auto_reload_on_write = true,
disable_netrw = false,
hijack_netrw = true,
sort_by = "case_sensitive",
view = {
width = 30,
number = true,
relativenumber = true,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
},
},
renderer = {
group_empty = false,
highlight_git = true,
icons = {
symlink_arrow = "",
glyphs = {
modified = "",
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "[ ]",
deleted = "",
ignored = "",
},
},
},
special_files = { "Cargo.toml", "README.md", "Readme.md", "readme.md" },
symlink_destination = true,
},
filters = {
dotfiles = true,
},
})
--------------------------------------------------------------------------------
-- open _things_...
--------------------------------------------------------------------------------
local function open_nvim_tree()
require("nvim-tree.api").tree.open()
end
-- UNDO THIS open_nvim_tree()

View File

@ -0,0 +1,67 @@
--------------------------------------------------------------------------------
-- initial setup
--------------------------------------------------------------------------------
-- disable netrw at the very start of init.lua (strongly advised by _nvim-tree.lua_)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
--------------------------------------------------------------------------------
-- Plugin setup
--------------------------------------------------------------------------------
-- 'nvim-tree.lua' setup
require("nvim-tree").setup({
auto_reload_on_write = true,
disable_netrw = false,
hijack_netrw = true,
sort_by = "case_sensitive",
view = {
width = 30,
number = true,
relativenumber = true,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
},
},
renderer = {
group_empty = false,
highlight_git = true,
icons = {
symlink_arrow = "",
glyphs = {
modified = "",
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "[ ]",
deleted = "",
ignored = "",
},
},
},
special_files = { "Cargo.toml", "README.md", "Readme.md", "readme.md" },
symlink_destination = true,
},
filters = {
dotfiles = true,
},
})
--------------------------------------------------------------------------------
-- open _things_...
--------------------------------------------------------------------------------
local function open_nvim_tree()
require("nvim-tree.api").tree.open()
end
-- UNDO THIS open_nvim_tree()