Skip to content

Commit 824a367

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7b59959 + 66e2a5a commit 824a367

File tree

3 files changed

+89
-29
lines changed

3 files changed

+89
-29
lines changed

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ If you are experiencing issues, please make sure you have the latest versions.
2121

2222
### Install External Dependencies
2323

24-
> **NOTE**
24+
> **NOTE**
2525
> [Backup](#FAQ) your previous configuration (if any exists)
2626
2727
External Requirements:
2828
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
2929
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
30+
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
31+
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
3032
- Language Setup:
3133
- If want to write Typescript, you need `npm`
3234
- If want to write Golang, you will need `go`
@@ -43,6 +45,8 @@ Neovim's configurations are located under the following paths, depending on your
4345
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
4446
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
4547

48+
### Install Kickstart
49+
4650
Clone kickstart.nvim:
4751

4852
<details><summary> Linux and Mac </summary>
@@ -58,13 +62,13 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HO
5862
If you're using `cmd.exe`:
5963

6064
```
61-
git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\
65+
git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\Local\nvim\
6266
```
6367

6468
If you're using `powershell.exe`
6569

6670
```
67-
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
71+
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
6872
```
6973

7074
</details>
@@ -85,21 +89,21 @@ information about extending and exploring Neovim.
8589

8690
### Getting Started
8791

88-
See [Effective Neovim: Instant IDE](https://youtu.be/stqUbv-5u2s), covering the
89-
previous version. Note: The install via init.lua is outdated, please follow the
90-
install instructions in this file instead. An updated video is coming soon.
92+
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
9193

9294
### Recommended Steps
9395

9496
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
9597
(so that you have your own copy that you can modify) and then installing you
9698
can install to your machine using the methods above.
9799

98-
> **NOTE**
100+
> **NOTE**
99101
> Your fork's url will be something like this: `https://github.com/<your_github_username>/kickstart.nvim.git`
100102
101103
#### Examples of adding popularly requested plugins
102104

105+
NOTE: You'll need to uncomment the line in the init.lua that turns on loading custom plugins.
106+
103107
<details>
104108
<summary>Adding autopairs</summary>
105109

@@ -192,3 +196,21 @@ This requires:
192196
```lua
193197
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
194198
```
199+
200+
Alternatively one can install gcc and make which don't require changing the config,
201+
the easiest way is to use choco:
202+
203+
1. install [chocolatey](https://chocolatey.org/install)
204+
either follow the instructions on the page or use winget,
205+
run in cmd as **admin**:
206+
```
207+
winget install --accept-source-agreements chocolatey.chocolatey
208+
```
209+
210+
2. install all requirements using choco, exit previous cmd and
211+
open a new one so that choco path is set, run in cmd as **admin**:
212+
```
213+
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
214+
```
215+
216+
Then continue with the [Install Kickstart](#Install-Kickstart) step.

init.lua

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ P.S. You can delete this when you're done too. It's your config now! :)
9090
vim.g.mapleader = ' '
9191
vim.g.maplocalleader = ' '
9292

93+
-- Set to true if you have a Nerd Font installed
94+
vim.g.have_nerd_font = false
95+
9396
-- [[ Setting options ]]
9497
-- See `:help vim.opt`
9598
-- NOTE: You can change these options as you wish!
@@ -146,8 +149,8 @@ vim.opt.splitright = true
146149
vim.opt.splitbelow = true
147150

148151
-- Sets how neovim will display certain whitespace in the editor.
149-
-- See :help 'list'
150-
-- and :help 'listchars'
152+
-- See `:help 'list'`
153+
-- and `:help 'listchars'`
151154
vim.opt.list = true
152155
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
153156

@@ -201,7 +204,7 @@ vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower win
201204
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
202205

203206
-- [[ Basic Autocommands ]]
204-
-- See :help lua-guide-autocommands
207+
-- See `:help lua-guide-autocommands`
205208

206209
-- Highlight when yanking (copying) text
207210
-- Try it with `yap` in normal mode
@@ -234,7 +237,7 @@ vim.opt.rtp:prepend(lazypath)
234237
-- :Lazy update
235238
--
236239
-- NOTE: Here is where you install your plugins.
237-
require('lazy').setup {
240+
require('lazy').setup({
238241
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
239242
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
240243

@@ -274,18 +277,18 @@ require('lazy').setup {
274277
-- lazy loading plugins that don't need to be loaded immediately at startup.
275278
--
276279
-- For example, in the following configuration, we use:
277-
-- event = 'VeryLazy'
280+
-- event = 'VimEnter'
278281
--
279-
-- which loads which-key after all the UI elements are loaded. Events can be
280-
-- normal autocommands events (:help autocomd-events).
282+
-- which loads which-key before all the UI elements are loaded. Events can be
283+
-- normal autocommands events (`:help autocmd-events`).
281284
--
282285
-- Then, because we use the `config` key, the configuration only runs
283286
-- after the plugin has been loaded:
284287
-- config = function() ... end
285288

286289
{ -- Useful plugin to show you pending keybinds.
287290
'folke/which-key.nvim',
288-
event = 'VeryLazy', -- Sets the loading event to 'VeryLazy'
291+
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
289292
config = function() -- This is the function that runs, AFTER loading
290293
require('which-key').setup()
291294

@@ -309,7 +312,7 @@ require('lazy').setup {
309312

310313
{ -- Fuzzy Finder (files, lsp, etc)
311314
'nvim-telescope/telescope.nvim',
312-
event = 'VeryLazy',
315+
event = 'VimEnter',
313316
branch = '0.1.x',
314317
dependencies = {
315318
'nvim-lua/plenary.nvim',
@@ -328,10 +331,15 @@ require('lazy').setup {
328331
},
329332
{ 'nvim-telescope/telescope-ui-select.nvim' },
330333

334+
<<<<<<< HEAD
331335
-- Useful for getting pretty icons, but requires special font.
332336
-- If you already have a Nerd Font, or terminal set up with fallback fonts
333337
-- you can enable this
334338
{ 'nvim-tree/nvim-web-devicons' },
339+
=======
340+
-- Useful for getting pretty icons, but requires a Nerd Font.
341+
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
342+
>>>>>>> upstream/master
335343
},
336344
config = function()
337345
-- Telescope is a fuzzy finder that comes with a lot of different things that
@@ -450,7 +458,7 @@ require('lazy').setup {
450458
-- Neovim. This is where `mason` and related plugins come into play.
451459
--
452460
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
453-
-- and elegantly composed help section, :help lsp-vs-treesitter
461+
-- and elegantly composed help section, `:help lsp-vs-treesitter`
454462

455463
-- This function gets run when an LSP attaches to a particular buffer.
456464
-- That is to say, every time a new file is opened that is associated with
@@ -741,7 +749,9 @@ require('lazy').setup {
741749
lazy = false, -- make sure we load this during startup if it is your main colorscheme
742750
priority = 1000, -- make sure to load this before all the other start plugins
743751
config = function()
744-
-- Load the colorscheme here
752+
-- Load the colorscheme here.
753+
-- Like many other themes, this one has different styles, and you could load
754+
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
745755
vim.cmd.colorscheme 'tokyonight-night'
746756

747757
-- You can configure highlights by doing something like
@@ -750,15 +760,15 @@ require('lazy').setup {
750760
},
751761

752762
-- Highlight todo, notes, etc in comments
753-
{ 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
763+
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
754764

755765
{ -- Collection of various small independent plugins/modules
756766
'echasnovski/mini.nvim',
757767
config = function()
758768
-- Better Around/Inside textobjects
759769
--
760770
-- Examples:
761-
-- - va) - [V]isually select [A]round [)]parenthen
771+
-- - va) - [V]isually select [A]round [)]paren
762772
-- - yinq - [Y]ank [I]nside [N]ext [']quote
763773
-- - ci' - [C]hange [I]nside [']quote
764774
require('mini.ai').setup { n_lines = 500 }
@@ -774,14 +784,15 @@ require('lazy').setup {
774784
-- You could remove this setup call if you don't like it,
775785
-- and try some other statusline plugin
776786
local statusline = require 'mini.statusline'
777-
statusline.setup()
787+
-- set use_icons to true if you have a Nerd Font
788+
statusline.setup { use_icons = vim.g.have_nerd_font }
778789

779-
-- You can confiure sections in the statusline by overriding their
780-
-- default behavior. For example, here we disable the section for
781-
-- cursor information because line numbers are already enabled
790+
-- You can configure sections in the statusline by overriding their
791+
-- default behavior. For example, here we set the section for
792+
-- cursor location to LINE:COLUMN
782793
---@diagnostic disable-next-line: duplicate-set-field
783794
statusline.section_location = function()
784-
return ''
795+
return '%2l:%-2v'
785796
end
786797

787798
-- ... and there is more!
@@ -807,7 +818,7 @@ require('lazy').setup {
807818
-- There are additional nvim-treesitter modules that you can use to interact
808819
-- with nvim-treesitter. You should go explore a few and see what interests you:
809820
--
810-
-- - Incremental selection: Included, see :help nvim-treesitter-incremental-selection-mod
821+
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
811822
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
812823
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
813824
end,
@@ -829,9 +840,35 @@ require('lazy').setup {
829840
-- This is the easiest way to modularize your config.
830841
--
831842
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
843+
<<<<<<< HEAD
832844
-- For additional information see: :help lazy.nvim-lazy.nvim-structuring-your-plugins
833845
{ import = 'custom.plugins' },
834846
}
847+
=======
848+
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
849+
-- { import = 'custom.plugins' },
850+
}, {
851+
ui = {
852+
-- If you have a Nerd Font, set icons to an empty table which will use the
853+
-- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table
854+
icons = vim.g.have_nerd_font and {} or {
855+
cmd = '',
856+
config = '🛠',
857+
event = '📅',
858+
ft = '📂',
859+
init = '',
860+
keys = '🗝',
861+
plugin = '🔌',
862+
runtime = '💻',
863+
require = '🌙',
864+
source = '📄',
865+
start = '🚀',
866+
task = '📌',
867+
lazy = '💤 ',
868+
},
869+
},
870+
})
871+
>>>>>>> upstream/master
835872

836873
-- The line beneath this is called `modeline`. See `:help modeline`
837874
-- vim: ts=2 sts=2 sw=2 et

lua/kickstart/health.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
--]]
77

88
local check_version = function()
9+
local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
910
if not vim.version.cmp then
10-
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version())))
11+
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
1112
return
1213
end
1314

1415
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
15-
vim.health.ok(string.format("Neovim version is: '%s'", tostring(vim.version())))
16+
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
1617
else
17-
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version())))
18+
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
1819
end
1920
end
2021

0 commit comments

Comments
 (0)