-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
105 lines (90 loc) · 2.9 KB
/
init.lua
File metadata and controls
105 lines (90 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
-- ===================================
-- Plugin Manager and Plugins
-- ===================================
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
'machakann/vim-highlightedyank',
'tpope/vim-commentary',
'nvim-lualine/lualine.nvim'
})
-- ===================================
-- Lualine Configuration
-- ===================================
require('lualine').setup({
options = {
icons_enabled = true,
theme = 'powerline_dark',
section_separators = {'', ''},
component_separators = {'|', '|'},
disabled_filetypes = {},
always_active = true,
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = {}
})
-- ===================================
-- General Neovim Settings
-- ===================================
-- Remap 'jj' to Escape in Insert mode
vim.api.nvim_set_keymap('i', 'jj', '<Esc>', { noremap = true, silent = true })
-- leader key maps
vim.g.mapleader = ' '
vim.api.nvim_set_keymap('n', '<leader>d', '"_dd', { noremap = true, silent = true }) --leader d deletes line without yanking
vim.api.nvim_set_keymap('n', '<leader>q', ':wq<CR>', { noremap = true, silent = true }) --leader q saves and quits
vim.api.nvim_set_keymap('v', '<leader>s', ':<C-u>s/', { noremap = true, silent = true }) --leader s enters subsitute mode (:s/) for the current selection
--
-- end of leader maps
-- Set clipboard option for system clipboard
vim.o.clipboard = 'unnamedplus'
-- Show context lines around the cursor
vim.o.scrolloff = 5
-- Enable incremental searching
vim.o.incsearch = true
-- Re-map 'Q' to format a block of text
vim.api.nvim_set_keymap('n', 'Q', 'gq', { noremap = false, silent = true })
-- Enable line numbers
vim.o.number = true
vim.o.cursorline = true
-- ===================================
-- Plugin-Specific Settings
-- ===================================
-- Highlight yanked text
vim.g.highlightedyank_highlight_duration = 200
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
vim.api.nvim_set_hl(0, 'Highlightedyank', { bg = 'green', fg = 'white' })
end
})
-- ===================================
-- VS Code Specific Settings
-- ===================================
if vim.g.vscode then
else
end