How to setup VIM

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: How to setup VIM

Post by Inny » Wed Apr 19, 2017 11:59 pm

Leave a blank line between function declarations, and use the curly braces { and } to "jump paragraph"

There's more tips here: http://vim.wikia.com/wiki/Moving_around

User avatar
yetneverdone
Party member
Posts: 349
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: How to setup VIM

Post by yetneverdone » Thu Apr 20, 2017 12:25 am

Inny wrote:
Wed Apr 19, 2017 11:59 pm
Leave a blank line between function declarations, and use the curly braces { and } to "jump paragraph"

There's more tips here: http://vim.wikia.com/wiki/Moving_around
Did you mean like this form?

function etc etc
--line
function etc etc etc
--line

User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: How to setup VIM

Post by Inny » Thu Apr 20, 2017 7:43 pm

yetneverdone wrote:
Thu Apr 20, 2017 12:25 am
Did you mean like this form?
No, like this:

Code: Select all

function name(args)
  -- body
end
  
local function other_name(args)
  -- body
end

this_is_okay_too = function(args)
  -- body
end
The key is there is an empty line between declarations, so vim knows where to jump to.

User avatar
yetneverdone
Party member
Posts: 349
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: How to setup VIM

Post by yetneverdone » Thu Apr 20, 2017 7:46 pm

Inny wrote:
Thu Apr 20, 2017 7:43 pm
yetneverdone wrote:
Thu Apr 20, 2017 12:25 am
Did you mean like this form?
No, like this:

Code: Select all

function name(args)
  -- body
end
  
local function other_name(args)
  -- body
end

this_is_okay_too = function(args)
  -- body
end
The key is there is an empty line between declarations, so vim knows where to jump to.
That was what i meant haha just got lazy typing in mobile. Well that works but not in all case jumps around functions since if there is also an empty line in between function and end,it will jump to that.

davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: How to setup VIM

Post by davisdude » Mon May 08, 2017 8:55 pm

davisdude wrote:
Wed Mar 29, 2017 8:18 pm
Inny wrote:
Wed Mar 29, 2017 3:44 pm
Edit: Oh hey, that start cmd /c might be useful here. I guess I'll be doing that from now on. (This is the life of being a vim user, you're always learning a new tip)
Yeah, it took me a while to figure out something that really worked for my needs. For running single files, I actually use "!start cmd /c python % && pause" that way I can see the output of the console before it closes. I'm not completely sure if it works on Linux or not, though. I definitely second this, as well as the "Don't just blindly use them unless you understand them" bit.
Btw I figured out a better way to do this. With the old method, the console automatically quits on errors, which makes it hard to debug... So here's the improved version:

Code: Select all

<leader>r :silent !start cmd /c "lua % & pause"<CR>
The quotes surrounding it means to execute the first, then the second (pause), allowing you to see the error.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim

User avatar
yetneverdone
Party member
Posts: 349
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: How to setup VIM

Post by yetneverdone » Fri Dec 28, 2018 2:42 pm

You can use vim-dispatch to do that, and also to edit the code while the game is running (good for hot reloading)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests