diff --git a/init.lua b/init.lua index 5de9ec64..44471a68 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,4 @@ -require("options") -require("plugins") -require("keymaps") -require("autocmds") \ No newline at end of file +require("config.options") +require("config.keymaps") +require("config.autocmds") +require("config.lazy") diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 00000000..d8bcaf66 --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,10 @@ +{ + "extras": [ + + ], + "install_version": 8, + "news": { + "NEWS.md": "11866" + }, + "version": 8 +} \ No newline at end of file diff --git a/lua/autocmds.lua b/lua/config/autocmds.lua similarity index 100% rename from lua/autocmds.lua rename to lua/config/autocmds.lua diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 00000000..1afeab22 --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,17 @@ +local map = vim.keymap.set +map('i', 'jk', '', { desc = 'Exit insert mode' }) + +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +map('n', '', 'nohlsearch') +map('n', '', function() + print("hey") +end, { desc = "Print hey" }) +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- See `:help wincmd` for a list of all window commands +map('n', '', '', { desc = 'Move focus to the left window' }) +map('n', '', '', { desc = 'Move focus to the right window' }) +map('n', '', '', { desc = 'Move focus to the lower window' }) +map('n', '', '', { desc = 'Move focus to the upper window' }) + diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 00000000..4d06e794 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,36 @@ +-- Install lazy +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + error("Error cloning lazy.nvim:\n" .. out) + end +end + +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + import = "plugins", + }, + { + ui = { + -- If you are using 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 = "💤 ", + }, + }, +}) diff --git a/lua/options.lua b/lua/config/options.lua similarity index 90% rename from lua/options.lua rename to lua/config/options.lua index ea3a1f82..ef8d3619 100644 --- a/lua/options.lua +++ b/lua/config/options.lua @@ -1,9 +1,5 @@ --- Set as the leader key --- See `:help mapleader` --- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' - -- Make line numbers default vim.opt.number = true @@ -56,3 +52,5 @@ vim.opt.updatetime = 300 vim.opt.expandtab = true vim.opt.tabstop = 4 vim.opt.shiftwidth = 4 + +vim.opt.virtualedit = "block" diff --git a/lua/keymaps.lua b/lua/keymaps.lua deleted file mode 100644 index ea1d6e6e..00000000 --- a/lua/keymaps.lua +++ /dev/null @@ -1,15 +0,0 @@ --- [[ Basic Keymaps ]] - -vim.keymap.set('i', 'jk', '', { desc = 'Exit insert mode' }) - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) \ No newline at end of file diff --git a/lua/plugins.lua b/lua/plugins/plugins.lua similarity index 70% rename from lua/plugins.lua rename to lua/plugins/plugins.lua index f85c12bc..41652a63 100644 --- a/lua/plugins.lua +++ b/lua/plugins/plugins.lua @@ -1,16 +1,5 @@ --- Install lazy -local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } - if vim.v.shell_error ~= 0 then - error('Error cloning lazy.nvim:\n' .. out) - end -end +return { -vim.opt.rtp:prepend(lazypath) - -require('lazy').setup({ { 'rebelot/kanagawa.nvim', priority = 1000, @@ -18,6 +7,7 @@ require('lazy').setup({ vim.cmd.colorscheme "kanagawa-wave" end, }, + { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', @@ -53,6 +43,7 @@ require('lazy').setup({ -- vim.lsp.enable('pyright') -- end, -- } + { -- handle LSP server installation and management -- let's be lazy for now. @@ -66,6 +57,7 @@ require('lazy').setup({ require("mason-lspconfig").setup() end, }, + { -- Auto completion engine 'saghen/blink.cmp', dependencies = { 'rafamadriz/friendly-snippets' }, @@ -83,6 +75,7 @@ require('lazy').setup({ }, opts_extend = { "sources.default" }, }, + { -- Let lsp recognize vim functions "folke/lazydev.nvim", ft = "lua", -- only load on lua files @@ -92,26 +85,12 @@ require('lazy').setup({ }, }, }, -}, - { - ui = { - -- If you are using 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 = '💤 ', - }, - }, -}) + { + 'nvim-telescope/telescope.nvim', tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + require('telescope').setup({}) + end, + } +} diff --git a/sample.py b/sample.py index 828bd902..c350cc6f 100644 --- a/sample.py +++ b/sample.py @@ -1,4 +1,42 @@ -printf() -print() -hi -print() + +print("hello, world, ") + +print("hello, world, ") +print("hello sir") +json = { + "a" : 1, + "b" : 2, + "c" : 3, + "d" : 4, +} +print("file name sample.py") + +#################################################### + +print("hello, worldworld") +print("hello, world, ") + +print("hello, world, ") +print("hello, world, ") +json = { + "a" : 1, + "b" : 2, + "c" : 3, + "d" : 4, +} +print("file name sample.py") +if True: + print("hello, world") + +#################################################### + +#################################################### +json = { + "a" : 1, + "b" : 2, + "c" : 3, + "d" : 4, +} +print("file name sample.py") +if True: + print("hello, world")