Skip to content

update kickstart #1451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
https://www.reddit.com/r/neovim/comments/193hxsb/i_write_sql_most_days_is_neovim_still_worth_it/

# kickstart.nvim

## Introduction
Expand Down Expand Up @@ -83,7 +85,7 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\L
If you're using `powershell.exe`

```
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
gimv /home/user/oldname /home/user/newnamet clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
```

</details>
Expand Down
70 changes: 53 additions & 17 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,17 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true

-- [[ Setting options ]]
-- See `:help vim.opt`
-- NOTE: You can change these options as you wish!
-- For more options, you can see `:help option-list`

-- Русский язык
vim.opt.langmap =
"ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz"

-- Make line numbers default
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
Expand All @@ -118,8 +122,15 @@ vim.opt.clipboard = 'unnamedplus'
-- Enable break indent
vim.opt.breakindent = true

-- My settings
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.swapfile = false
vim.opt.backup = false

-- Save undo history
vim.opt.undofile = true
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"

-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt.ignorecase = true
Expand Down Expand Up @@ -156,6 +167,13 @@ vim.opt.scrolloff = 10

-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
vim.keymap.set("i", "jk", "<Esc>")

-- Set pasting from 0 register
vim.keymap.set('n', '<leader>p', '"0p')
-- Set deleting into nothing
vim.keymap.set('n', '<leader>d', '"_d')
vim.keymap.set('x', '<leader>d', '"_d')

-- Set highlight on search, but clear on pressing <Esc> in normal mode
vim.opt.hlsearch = true
Expand Down Expand Up @@ -238,7 +256,7 @@ require('lazy').setup({
-- require('Comment').setup({})

-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
{ 'numToStr/Comment.nvim', opts = {} },

-- Here is a more advanced example where we pass configuration
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
Expand Down Expand Up @@ -275,11 +293,10 @@ require('lazy').setup({

{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
config = function() -- This is the function that runs, AFTER loading
require('which-key').setup()

-- Document existing key chains
version = "2.1.0",
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
config = function() -- This is the function that runs, AFTER loading
require('which-key').setup() -- Document existing key chains
require('which-key').register {
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
Expand Down Expand Up @@ -325,7 +342,7 @@ require('lazy').setup({
{ 'nvim-telescope/telescope-ui-select.nvim' },

-- Useful for getting pretty icons, but requires a Nerd Font.
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_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
Expand Down Expand Up @@ -418,11 +435,11 @@ require('lazy').setup({

-- Useful status updates for LSP.
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
{ 'j-hui/fidget.nvim', opts = {} },

-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
{ 'folke/neodev.nvim', opts = {} },
{ 'folke/neodev.nvim', opts = {} },
},
config = function()
-- Brief aside: **What is LSP?**
Expand Down Expand Up @@ -577,6 +594,21 @@ require('lazy').setup({
-- But for many setups, the LSP (`tsserver`) will work just fine
-- tsserver = {},
--
--
pylsp = {
settings = {
pylsp = {
plugins = {
pycodestyle = {
maxLineLength = 120,
},
flake8 = {
maxLineLength = 120,
}
}
}
}
},

lua_ls = {
-- cmd = {...},
Expand Down Expand Up @@ -605,9 +637,9 @@ require('lazy').setup({
-- You can add other tools here that you want Mason to install
-- for you, so that they are available from within Neovim.
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'stylua', -- Used to format Lua code
})
--vim.list_extend(ensure_installed, {
-- 'stylua', -- Used to format Lua code
--})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }

require('mason-lspconfig').setup {
Expand All @@ -627,6 +659,7 @@ require('lazy').setup({

{ -- Autoformat
'stevearc/conform.nvim',
version = "7.1.0",
lazy = false,
keys = {
{
Expand All @@ -639,7 +672,7 @@ require('lazy').setup({
},
},
opts = {
notify_on_error = false,
notify_on_error = true,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
Expand All @@ -652,6 +685,7 @@ require('lazy').setup({
end,
formatters_by_ft = {
lua = { 'stylua' },
python = { 'black', args = { "--line-length", "120" } },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
Expand Down Expand Up @@ -785,7 +819,8 @@ require('lazy').setup({
-- 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'

vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
end,
Expand Down Expand Up @@ -835,7 +870,7 @@ 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' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
Expand Down Expand Up @@ -885,7 +920,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
Expand All @@ -910,3 +945,4 @@ require('lazy').setup({

-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
require('lspconfig').svelte.setup { filetypes = { "svelte", "html" } }
38 changes: 38 additions & 0 deletions lua/custom/plugins/fugitive.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)

local Chibs_Fugitive = vim.api.nvim_create_augroup("ThePrimeagen_Fugitive", {})

local autocmd = vim.api.nvim_create_autocmd
autocmd("BufWinEnter", {
group = Chibs_Fugitive,
pattern = "*",
callback = function()
if vim.bo.ft ~= "fugitive" then
return
end

local bufnr = vim.api.nvim_get_current_buf()
local opts = { buffer = bufnr, remap = false }
vim.keymap.set("n", "<leader>p", function()
vim.cmd.Git('push')
end, opts)

-- rebase always
vim.keymap.set("n", "<leader>P", function()
vim.cmd.Git({ 'pull', '--rebase' })
end, opts)

-- NOTE: It allows me to easily set the branch i am pushing and any tracking
-- needed if i did not set the branch up correctly
vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts);
end,
})


vim.keymap.set("n", "gu", "<cmd>diffget //2<CR>")
vim.keymap.set("n", "gh", "<cmd>diffget //3<CR>")
end
}
24 changes: 24 additions & 0 deletions lua/custom/plugins/oil.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
return {
{
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("oil").setup {
columns = { "icon" },
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
},
view_options = {
show_hidden = true,
},
}

-- Open parent directory in current window
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })

-- Open parent directory in floating window
vim.keymap.set("n", "<space>-", require("oil").toggle_float)
end,
},
}
10 changes: 10 additions & 0 deletions lua/custom/plugins/toggleterm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
'akinsho/toggleterm.nvim',
version = "*",
config = true,
keys = {
{ '<leader>t', ":ToggleTerm size=15<cr>" },
{ '<leader>t', mode = { "t" }, "<C-\\><C-n><CMD>ToggleTerm size=15<cr>" },
{ '<esc>', mode = { "t" }, [[<C-\><C-n>]] }
}
}
1 change: 1 addition & 0 deletions lua/custom/plugins/transparent.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
return { "xiyaowong/transparent.nvim" }
7 changes: 7 additions & 0 deletions lua/custom/plugins/undotree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
"mbbill/undotree",

config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end
}
32 changes: 32 additions & 0 deletions lua/custom/plugins/zenmode.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
return {
"folke/zen-mode.nvim",
config = function()
vim.keymap.set("n", "<leader>zz", function()
require("zen-mode").setup {
window = {
width = 90,
options = {}
},
}
require("zen-mode").toggle()
vim.wo.wrap = false
vim.wo.number = true
vim.wo.rnu = true
end)


vim.keymap.set("n", "<leader>zZ", function()
require("zen-mode").setup {
window = {
width = 80,
options = {}
},
}
require("zen-mode").toggle()
vim.wo.wrap = false
vim.wo.number = false
vim.wo.rnu = false
vim.opt.colorcolumn = "0"
end)
end
}
3 changes: 2 additions & 1 deletion lua/kickstart/plugins/lint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ return {
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}

local flake8 = lint.linters.flake8
flake8.cmd = "flake8 --max-line-length 120"
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
Expand Down
Loading