Compare commits

...

13 Commits

9 changed files with 75 additions and 21 deletions

View File

@ -21,6 +21,8 @@ If you are experiencing issues, please make sure you have the latest versions.
External Requirements:
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
- Language Setup:
- If want to write Typescript, you need `npm`
- If want to write Golang, you will need `go`

View File

@ -3,6 +3,9 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed
vim.g.have_nerd_font = true
-- [[ Setting options ]]
require 'options'

View File

@ -12,13 +12,11 @@ vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagn
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
-- is not what someone will guess without a bit more experience.
--
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
-- or just use <C-\><C-n> to exit terminal mode
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- Open terminal in current window
vim.keymap.set({ 'n', 'v' }, '<leader>to', '<cmd>term<cr>', { desc = '[T]erminal [O]pen' })
-- Disable arrow keys in normal mode
vim.keymap.set({ 'n', 'v' }, '<left>', '<cmd>echo "Use h to move!!"<CR>')
vim.keymap.set({ 'n', 'v' }, '<right>', '<cmd>echo "Use l to move!!"<CR>')
@ -42,8 +40,8 @@ vim.keymap.set('v', '<leader>pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' })
-- Populate CMD to prepare for change directory
vim.keymap.set('n', '<leader>cd', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' })
-- Open git window from fugitive in full screen
vim.keymap.set({ 'n', 'v' }, '<leader>go', ':Git<enter><C-w>o', { desc = '[G]it [O]pen' })
-- Switch in fugitive.vim status window with the current one
vim.keymap.set('n', '<leader>gs', '<cmd>Gedit :<cr>', { desc = '[G]it [S]tatus' })
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`

View File

@ -21,7 +21,8 @@ return {
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
local statusline = require 'mini.statusline'
statusline.setup()
-- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font }
-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for

View File

@ -27,10 +27,8 @@ return {
},
{ 'nvim-telescope/telescope-ui-select.nvim' },
-- Useful for getting pretty icons, but requires special font.
-- If you already have a Nerd Font, or terminal set up with fallback fonts
-- you can enable this
{ 'nvim-tree/nvim-web-devicons' },
-- Useful for getting pretty icons, but requires a Nerd Font.
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
},
config = function()
-- Telescope is a fuzzy finder that comes with a lot of different things that

View File

@ -8,7 +8,9 @@ return {
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
-- Load the colorscheme here
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
-- You can configure highlights by doing something like

View File

@ -3,6 +3,7 @@ return {
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'windwp/nvim-ts-autotag',
'nvim-treesitter/nvim-treesitter-context',
'nvim-treesitter/nvim-treesitter-textobjects',
},
@ -15,6 +16,11 @@ return {
ensure_installed = { 'lua', 'python', 'rust', 'javascript', 'typescript', 'vimdoc', 'vim', 'svelte', 'c_sharp' },
-- Autoinstall languages that are not installed
auto_install = false,
-- Enable autotags and -rename
autotag = {
enable = true,
enable_autocmd = true,
},
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
highlight = { enable = true },
@ -73,11 +79,6 @@ return {
},
},
}
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
end,
},
}

View File

@ -9,7 +9,7 @@
-- :Lazy update
--
-- NOTE: Here is where you install your plugins.
require('lazy').setup {
require('lazy').setup({
-- [[ Plugin Specs list ]]
-- NOTE: First, some plugins that don't require any configuration
@ -23,6 +23,34 @@ require('lazy').setup {
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
-- Smooth scroll plugin and keymaps
{
'karb94/neoscroll.nvim',
config = function()
require('neoscroll').setup {
hide_cursor = false,
easing_function = nil,
respect_scrolloff = true,
}
require('neoscroll.config').set_mappings {
-- Scroll normally
['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '50' } },
['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '50' } },
-- Scroll entire page height
['<C-b>'] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '80' } },
['<C-f>'] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '80' } },
-- Scroll 10% at a time
['<C-y>'] = { 'scroll', { '-0.10', 'false', '25' } },
['<C-e>'] = { 'scroll', { '0.10', 'false', '25' } },
-- Jump to top, bottom and center
['zt'] = { 'zt', { '40' } },
['zz'] = { 'zz', { '50' } },
['zb'] = { 'zb', { '40' } },
}
end,
},
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
@ -82,6 +110,26 @@ 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' },
}
}, {
ui = {
-- If you have a Nerd Font, set icons to an empty table which will use the
-- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table
icons = vim.g.have_nerd_font and {} or {
cmd = '',
config = '🛠',
event = '📅',
ft = '📂',
init = '',
keys = '🗝',
plugin = '🔌',
runtime = '💻',
require = '🌙',
source = '📄',
start = '🚀',
task = '📌',
lazy = '💤 ',
},
},
})
-- vim: ts=2 sts=2 sw=2 et

View File

@ -77,7 +77,8 @@ vim.opt.inccommand = 'split'
-- Show which line your cursor is on
vim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor.
-- Minimal spacing to keep around the cursor.
vim.opt.scrolloff = 8
vim.opt.sidescrolloff = 12
-- vim: ts=2 sts=2 sw=2 et