about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-07 17:39:33 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-07 17:39:33 +0100
commit10a02b2ae2613b383453ba99318330560e9371ac (patch)
treec14e3e5e477d257aa7141483c09a52568e5a9458 /src
parent22f127b1124608dc7bcc13165e382bfbaa803764 (diff)
downloadchawan-10a02b2ae2613b383453ba99318330560e9371ac.tar.gz
Use std/* imports everywhere
Diffstat (limited to 'src')
-rw-r--r--src/bindings/termcap.nim2
-rw-r--r--src/config/config.nim8
-rw-r--r--src/config/mailcap.nim6
-rw-r--r--src/config/mimetypes.nim6
-rw-r--r--src/config/toml.nim10
-rw-r--r--src/css/cascade.nim6
-rw-r--r--src/css/cssparser.nim6
-rw-r--r--src/css/match.nim8
-rw-r--r--src/css/mediaquery.nim4
-rw-r--r--src/css/selectorparser.nim6
-rw-r--r--src/css/sheet.nim6
-rw-r--r--src/css/values.nim10
-rw-r--r--src/display/lineedit.nim6
-rw-r--r--src/display/term.nim18
-rw-r--r--src/display/winattrs.nim4
-rw-r--r--src/extern/editor.nim2
-rw-r--r--src/extern/runproc.nim4
-rw-r--r--src/extern/stdio.nim2
-rw-r--r--src/extern/tempfile.nim2
-rw-r--r--src/html/chadombuilder.nim6
-rw-r--r--src/html/enums.nim4
-rw-r--r--src/html/event.nim4
-rw-r--r--src/img/painter.nim4
-rw-r--r--src/img/path.nim6
-rw-r--r--src/img/png.nim2
-rw-r--r--src/io/multistream.nim2
-rw-r--r--src/io/posixstream.nim4
-rw-r--r--src/io/promise.nim2
-rw-r--r--src/io/serialize.nim8
-rw-r--r--src/io/serversocket.nim3
-rw-r--r--src/io/socketstream.nim10
-rw-r--r--src/io/teestream.nim2
-rw-r--r--src/io/urlfilter.nim2
-rw-r--r--src/js/domexception.nim2
-rw-r--r--src/js/fromjs.nim10
-rw-r--r--src/js/javascript.nim16
-rw-r--r--src/js/opaque.nim2
-rw-r--r--src/js/regex.nim2
-rw-r--r--src/js/timeout.nim6
-rw-r--r--src/layout/engine.nim8
-rw-r--r--src/loader/cgi.nim10
-rw-r--r--src/loader/headers.nim2
-rw-r--r--src/loader/loaderhandle.nim4
-rw-r--r--src/loader/request.nim8
-rw-r--r--src/loader/response.nim4
-rw-r--r--src/local/client.nim22
-rw-r--r--src/local/container.nim10
-rw-r--r--src/local/pager.nim18
-rw-r--r--src/main.nim11
-rw-r--r--src/render/renderdocument.nim4
-rw-r--r--src/render/rendertext.nim4
-rw-r--r--src/types/buffersource.nim4
-rw-r--r--src/types/cell.nim4
-rw-r--r--src/types/color.nim6
-rw-r--r--src/types/cookie.nim4
-rw-r--r--src/types/referer.nim5
-rw-r--r--src/types/urimethodmap.nim4
-rw-r--r--src/types/vector.nim2
-rw-r--r--src/utils/map.nim2
-rw-r--r--src/utils/mimeguess.nim6
-rw-r--r--src/utils/twtstr.nim22
-rw-r--r--src/version.nim2
62 files changed, 189 insertions, 190 deletions
diff --git a/src/bindings/termcap.nim b/src/bindings/termcap.nim
index 5a98ccc0..4cc3241b 100644
--- a/src/bindings/termcap.nim
+++ b/src/bindings/termcap.nim
@@ -1,4 +1,4 @@
-import os
+import std/os
 const termlib = (proc(): string =
   const libs = [
     "terminfo", "mytinfo", "termlib", "termcap", "tinfo", "ncurses", "curses"
diff --git a/src/config/config.nim b/src/config/config.nim
index 46ae2a08..634184d9 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -1,7 +1,7 @@
-import tables
-import options
-import os
-import streams
+import std/options
+import std/os
+import std/streams
+import std/tables
 
 import config/chapath
 import config/mailcap
diff --git a/src/config/mailcap.nim b/src/config/mailcap.nim
index a53ce24a..bc267764 100644
--- a/src/config/mailcap.nim
+++ b/src/config/mailcap.nim
@@ -1,8 +1,8 @@
 # See https://www.rfc-editor.org/rfc/rfc1524
 
-import osproc
-import streams
-import strutils
+import std/osproc
+import std/streams
+import std/strutils
 
 import types/url
 import types/opt
diff --git a/src/config/mimetypes.nim b/src/config/mimetypes.nim
index 577fcbed..a7c18a57 100644
--- a/src/config/mimetypes.nim
+++ b/src/config/mimetypes.nim
@@ -1,6 +1,6 @@
-import streams
-import strutils
-import tables
+import std/streams
+import std/strutils
+import std/tables
 
 import utils/twtstr
 
diff --git a/src/config/toml.nim b/src/config/toml.nim
index 4440dff4..8c9d4b4c 100644
--- a/src/config/toml.nim
+++ b/src/config/toml.nim
@@ -1,8 +1,8 @@
-import streams
-import tables
-import times
-import strutils
-import unicode
+import std/streams
+import std/strutils
+import std/tables
+import std/times
+import std/unicode
 
 import types/opt
 import utils/twtstr
diff --git a/src/css/cascade.nim b/src/css/cascade.nim
index 4f71d8c6..173b2af3 100644
--- a/src/css/cascade.nim
+++ b/src/css/cascade.nim
@@ -1,6 +1,6 @@
-import algorithm
-import options
-import strutils
+import std/algorithm
+import std/options
+import std/strutils
 
 import css/cssparser
 import css/match
diff --git a/src/css/cssparser.nim b/src/css/cssparser.nim
index c63a7422..6f4f666a 100644
--- a/src/css/cssparser.nim
+++ b/src/css/cssparser.nim
@@ -1,6 +1,6 @@
-import options
-import streams
-import unicode
+import std/options
+import std/streams
+import std/unicode
 
 import js/domexception
 import types/opt
diff --git a/src/css/match.nim b/src/css/match.nim
index 1472f89b..bf78f6b5 100644
--- a/src/css/match.nim
+++ b/src/css/match.nim
@@ -1,7 +1,7 @@
-import options
-import streams
-import strutils
-import tables
+import std/options
+import std/streams
+import std/strutils
+import std/tables
 
 import css/cssparser
 import css/selectorparser
diff --git a/src/css/mediaquery.nim b/src/css/mediaquery.nim
index f92ecfb2..5a73712d 100644
--- a/src/css/mediaquery.nim
+++ b/src/css/mediaquery.nim
@@ -1,5 +1,5 @@
-import strutils
-import tables
+import std/strutils
+import std/tables
 
 import css/cssparser
 import css/values
diff --git a/src/css/selectorparser.nim b/src/css/selectorparser.nim
index 0e892ad6..75f6182a 100644
--- a/src/css/selectorparser.nim
+++ b/src/css/selectorparser.nim
@@ -1,6 +1,6 @@
-import options
-import streams
-import strutils
+import std/options
+import std/streams
+import std/strutils
 
 import css/cssparser
 import utils/twtstr
diff --git a/src/css/sheet.nim b/src/css/sheet.nim
index 0447c23d..2db7b47a 100644
--- a/src/css/sheet.nim
+++ b/src/css/sheet.nim
@@ -1,6 +1,6 @@
-import algorithm
-import streams
-import tables
+import std/algorithm
+import std/streams
+import std/tables
 
 import css/mediaquery
 import css/cssparser
diff --git a/src/css/values.nim b/src/css/values.nim
index db2f4475..ddde8953 100644
--- a/src/css/values.nim
+++ b/src/css/values.nim
@@ -1,8 +1,8 @@
-import macros
-import options
-import strutils
-import tables
-import unicode
+import std/macros
+import std/options
+import std/strutils
+import std/tables
+import std/unicode
 
 import css/cssparser
 import css/selectorparser
diff --git a/src/display/lineedit.nim b/src/display/lineedit.nim
index 5edb31d0..7eef9bfb 100644
--- a/src/display/lineedit.nim
+++ b/src/display/lineedit.nim
@@ -1,6 +1,6 @@
-import streams
-import strutils
-import unicode
+import std/streams
+import std/strutils
+import std/unicode
 
 import bindings/quickjs
 import display/winattrs
diff --git a/src/display/term.nim b/src/display/term.nim
index 8e0f9544..3bcfbf4f 100644
--- a/src/display/term.nim
+++ b/src/display/term.nim
@@ -1,12 +1,12 @@
-import options
-import os
-import posix
-import streams
-import strutils
-import tables
-import terminal
-import termios
-import unicode
+import std/options
+import std/os
+import std/posix
+import std/streams
+import std/strutils
+import std/tables
+import std/terminal
+import std/termios
+import std/unicode
 
 import bindings/termcap
 import config/config
diff --git a/src/display/winattrs.nim b/src/display/winattrs.nim
index 74a713bc..3c453871 100644
--- a/src/display/winattrs.nim
+++ b/src/display/winattrs.nim
@@ -1,7 +1,7 @@
-import terminal
+import std/terminal
 
 when defined(posix):
-  import termios
+  import std/termios
 
 type
   WindowAttributes* = object
diff --git a/src/extern/editor.nim b/src/extern/editor.nim
index 9fb0fd89..f0abd4a9 100644
--- a/src/extern/editor.nim
+++ b/src/extern/editor.nim
@@ -1,4 +1,4 @@
-import os
+import std/os
 
 import config/config
 import display/term
diff --git a/src/extern/runproc.nim b/src/extern/runproc.nim
index 6cad73a0..4b2ec013 100644
--- a/src/extern/runproc.nim
+++ b/src/extern/runproc.nim
@@ -1,5 +1,5 @@
-import streams
-import posix
+import std/posix
+import std/streams
 
 import display/term
 
diff --git a/src/extern/stdio.nim b/src/extern/stdio.nim
index 63c0e88d..7fc1461d 100644
--- a/src/extern/stdio.nim
+++ b/src/extern/stdio.nim
@@ -1,4 +1,4 @@
-import posix
+import std/posix
 
 proc closeHandle(fd, flags: cint) =
   let devnull = open("/dev/null", flags)
diff --git a/src/extern/tempfile.nim b/src/extern/tempfile.nim
index d99ea4dc..75c09835 100644
--- a/src/extern/tempfile.nim
+++ b/src/extern/tempfile.nim
@@ -1,4 +1,4 @@
-import os
+import std/os
 
 var tmpf_seq: int
 proc getTempFile*(tmpdir: string, ext = ""): string =
diff --git a/src/html/chadombuilder.nim b/src/html/chadombuilder.nim
index 06d411dc..fa3b761d 100644
--- a/src/html/chadombuilder.nim
+++ b/src/html/chadombuilder.nim
@@ -1,6 +1,6 @@
-import deques
-import options
-import streams
+import std/deques
+import std/options
+import std/streams
 
 import html/dom
 import html/enums
diff --git a/src/html/enums.nim b/src/html/enums.nim
index 5cc4e466..e990495e 100644
--- a/src/html/enums.nim
+++ b/src/html/enums.nim
@@ -1,5 +1,5 @@
-import strutils
-import tables
+import std/strutils
+import std/tables
 
 import utils/twtstr
 
diff --git a/src/html/event.nim b/src/html/event.nim
index 47195b82..8a5c6edc 100644
--- a/src/html/event.nim
+++ b/src/html/event.nim
@@ -1,5 +1,5 @@
-import math
-import times
+import std/math
+import std/times
 
 import bindings/quickjs
 import js/dict
diff --git a/src/img/painter.nim b/src/img/painter.nim
index d52aaff1..c52cb02e 100644
--- a/src/img/painter.nim
+++ b/src/img/painter.nim
@@ -1,5 +1,5 @@
-import algorithm
-import unicode
+import std/algorithm
+import std/unicode
 
 import css/values
 import img/bitmap
diff --git a/src/img/path.nim b/src/img/path.nim
index 0ec7537c..a1ef9cb7 100644
--- a/src/img/path.nim
+++ b/src/img/path.nim
@@ -1,6 +1,6 @@
-import algorithm
-import deques
-import math
+import std/algorithm
+import std/deques
+import std/math
 
 import types/line
 import types/vector
diff --git a/src/img/png.nim b/src/img/png.nim
index fdf02197..8239c35f 100644
--- a/src/img/png.nim
+++ b/src/img/png.nim
@@ -1,4 +1,4 @@
-import math
+import std/math
 
 import bindings/zlib
 import img/bitmap
diff --git a/src/io/multistream.nim b/src/io/multistream.nim
index 33038ad6..cf6814ab 100644
--- a/src/io/multistream.nim
+++ b/src/io/multistream.nim
@@ -2,7 +2,7 @@
 # stream.
 # See TeeStream for a pull version.
 
-import streams
+import std/streams
 
 type MultiStream = ref object of Stream
   s1: Stream
diff --git a/src/io/posixstream.nim b/src/io/posixstream.nim
index 5e9082a9..dbc48ece 100644
--- a/src/io/posixstream.nim
+++ b/src/io/posixstream.nim
@@ -1,6 +1,6 @@
 # stdlib file handling is broken, so we use this instead of FileStream.
-import posix
-import streams
+import std/posix
+import std/streams
 
 type
   PosixStream* = ref object of Stream
diff --git a/src/io/promise.nim b/src/io/promise.nim
index 549b878e..c7942190 100644
--- a/src/io/promise.nim
+++ b/src/io/promise.nim
@@ -1,4 +1,4 @@
-import tables
+import std/tables
 
 import types/opt
 
diff --git a/src/io/serialize.nim b/src/io/serialize.nim
index 244dc201..0c9cfd8e 100644
--- a/src/io/serialize.nim
+++ b/src/io/serialize.nim
@@ -1,9 +1,9 @@
 # Write data to streams.
 
-import options
-import sets
-import streams
-import tables
+import std/options
+import std/sets
+import std/streams
+import std/tables
 
 import loader/request
 import types/blob
diff --git a/src/io/serversocket.nim b/src/io/serversocket.nim
index c83af974..e8bbf549 100644
--- a/src/io/serversocket.nim
+++ b/src/io/serversocket.nim
@@ -1,8 +1,9 @@
 import std/nativesockets
 import std/net
 import std/os
+
 when defined(posix):
-  import posix
+  import std/posix
 
 type ServerSocket* = object
   sock*: Socket
diff --git a/src/io/socketstream.nim b/src/io/socketstream.nim
index 7fe7e831..31e4a3b7 100644
--- a/src/io/socketstream.nim
+++ b/src/io/socketstream.nim
@@ -1,10 +1,10 @@
-import nativesockets
-import net
-import os
-import streams
+import std/nativesockets
+import std/net
+import std/os
+import std/streams
 
 when defined(posix):
-  import posix
+  import std/posix
 
 import io/posixstream
 import io/serversocket
diff --git a/src/io/teestream.nim b/src/io/teestream.nim
index a8f5792e..f70d8c4f 100644
--- a/src/io/teestream.nim
+++ b/src/io/teestream.nim
@@ -1,7 +1,7 @@
 # TeeStream: write to another stream when reading from one stream.
 # See MultiStream for a push version.
 
-import streams
+import std/streams
 
 type TeeStream = ref object of Stream
   source: Stream
diff --git a/src/io/urlfilter.nim b/src/io/urlfilter.nim
index c0832b17..457d79f8 100644
--- a/src/io/urlfilter.nim
+++ b/src/io/urlfilter.nim
@@ -1,4 +1,4 @@
-import options
+import std/options
 
 import js/regex
 import types/url
diff --git a/src/js/domexception.nim b/src/js/domexception.nim
index cd1ea1ba..3d4a4a1e 100644
--- a/src/js/domexception.nim
+++ b/src/js/domexception.nim
@@ -1,4 +1,4 @@
-import tables
+import std/tables
 
 import bindings/quickjs
 import js/error
diff --git a/src/js/fromjs.nim b/src/js/fromjs.nim
index 2ffdb9e2..cf3abc6d 100644
--- a/src/js/fromjs.nim
+++ b/src/js/fromjs.nim
@@ -1,8 +1,8 @@
-import macros
-import options
-import strutils
-import tables
-import unicode
+import std/macros
+import std/options
+import std/strutils
+import std/tables
+import std/unicode
 
 import bindings/quickjs
 import io/promise
diff --git a/src/js/javascript.nim b/src/js/javascript.nim
index 3575bdf7..56ba8fd3 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -35,14 +35,14 @@
 # {.jspropnames.} overrides get_own_property_names. Must return a
 #   JSPropertyEnumList object.
 
-import macros
-import options
-import sets
-import streams
-import strformat
-import strutils
-import tables
-import unicode
+import std/macros
+import std/options
+import std/sets
+import std/streams
+import std/strformat
+import std/strutils
+import std/tables
+import std/unicode
 
 import js/error
 import js/fromjs
diff --git a/src/js/opaque.nim b/src/js/opaque.nim
index b1035815..135b6994 100644
--- a/src/js/opaque.nim
+++ b/src/js/opaque.nim
@@ -1,4 +1,4 @@
-import tables
+import std/tables
 
 import bindings/quickjs
 import js/error
diff --git a/src/js/regex.nim b/src/js/regex.nim
index d73e6e2b..cbf24134 100644
--- a/src/js/regex.nim
+++ b/src/js/regex.nim
@@ -1,5 +1,5 @@
 # Interface for QuickJS libregexp.
-import unicode
+import std/unicode
 
 import bindings/libregexp
 import bindings/quickjs
diff --git a/src/js/timeout.nim b/src/js/timeout.nim
index 4657ac35..8ef7c114 100644
--- a/src/js/timeout.nim
+++ b/src/js/timeout.nim
@@ -1,6 +1,6 @@
-import selectors
-import streams
-import tables
+import std/selectors
+import std/streams
+import std/tables
 
 import js/javascript
 
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index cc80d1d8..f6762881 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -1,7 +1,7 @@
-import algorithm
-import math
-import options
-import unicode
+import std/algorithm
+import std/math
+import std/options
+import std/unicode
 
 import css/stylednode
 import css/values
diff --git a/src/loader/cgi.nim b/src/loader/cgi.nim
index 4b61399e..1da8fc4d 100644
--- a/src/loader/cgi.nim
+++ b/src/loader/cgi.nim
@@ -1,8 +1,8 @@
-import options
-import os
-import posix
-import streams
-import strutils
+import std/options
+import std/os
+import std/posix
+import std/streams
+import std/strutils
 
 import extern/stdio
 import io/posixstream
diff --git a/src/loader/headers.nim b/src/loader/headers.nim
index 5e61fded..f097fa4f 100644
--- a/src/loader/headers.nim
+++ b/src/loader/headers.nim
@@ -1,4 +1,4 @@
-import tables
+import std/tables
 
 import bindings/quickjs
 import js/error
diff --git a/src/loader/loaderhandle.nim b/src/loader/loaderhandle.nim
index 65638cdc..1cddd5f8 100644
--- a/src/loader/loaderhandle.nim
+++ b/src/loader/loaderhandle.nim
@@ -1,5 +1,5 @@
-import net
-import streams
+import std/net
+import std/streams
 
 import io/multistream
 import io/posixstream
diff --git a/src/loader/request.nim b/src/loader/request.nim
index 36e42963..1182ca1b 100644
--- a/src/loader/request.nim
+++ b/src/loader/request.nim
@@ -1,7 +1,7 @@
-import options
-import streams
-import strutils
-import tables
+import std/options
+import std/streams
+import std/strutils
+import std/tables
 
 import bindings/quickjs
 import js/dict
diff --git a/src/loader/response.nim b/src/loader/response.nim
index 7aa07655..6fa6a974 100644
--- a/src/loader/response.nim
+++ b/src/loader/response.nim
@@ -1,5 +1,5 @@
-import streams
-import unicode
+import std/streams
+import std/unicode
 
 import bindings/quickjs
 import io/promise
diff --git a/src/local/client.nim b/src/local/client.nim
index d9971d70..b2784e1a 100644
--- a/src/local/client.nim
+++ b/src/local/client.nim
@@ -1,16 +1,16 @@
-import nativesockets
-import net
-import options
-import os
-import selectors
-import streams
-import strutils
-import tables
-import terminal
-import unicode
+import std/nativesockets
+import std/net
+import std/options
+import std/os
+import std/selectors
+import std/streams
+import std/strutils
+import std/tables
+import std/terminal
+import std/unicode
 
 when defined(posix):
-  import posix
+  import std/posix
 
 import std/exitprocs
 
diff --git a/src/local/container.nim b/src/local/container.nim
index ea1f5173..f010b988 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -1,10 +1,10 @@
-import deques
-import options
-import streams
-import unicode
+import std/deques
+import std/options
+import std/streams
+import std/unicode
 
 when defined(posix):
-  import posix
+  import std/posix
 
 import config/config
 import display/winattrs
diff --git a/src/local/pager.nim b/src/local/pager.nim
index c69d3a28..228a79b9 100644
--- a/src/local/pager.nim
+++ b/src/local/pager.nim
@@ -1,14 +1,14 @@
-import deques
-import net
-import options
-import os
-import osproc
-import streams
-import tables
-import unicode
+import std/deques
+import std/net
+import std/options
+import std/os
+import std/osproc
+import std/streams
+import std/tables
+import std/unicode
 
 when defined(posix):
-  import posix
+  import std/posix
 
 import config/chapath
 import config/config
diff --git a/src/main.nim b/src/main.nim
index 0d04bf3f..333982dc 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -3,13 +3,10 @@ import version
 import server/forkserver
 let forks = newForkServer()
 
-import options
-import os
-import posix
-import terminal
-
-when defined(profile):
-  import nimprof
+import std/options
+import std/os
+import std/posix
+import std/terminal
 
 import config/chapath
 import config/config
diff --git a/src/render/renderdocument.nim b/src/render/renderdocument.nim
index f1404c6d..264489e4 100644
--- a/src/render/renderdocument.nim
+++ b/src/render/renderdocument.nim
@@ -1,5 +1,5 @@
-import strutils
-import unicode
+import std/strutils
+import std/unicode
 
 import css/stylednode
 import css/values
diff --git a/src/render/rendertext.nim b/src/render/rendertext.nim
index 39380ee0..0d54d75d 100644
--- a/src/render/rendertext.nim
+++ b/src/render/rendertext.nim
@@ -1,5 +1,5 @@
-import streams
-import unicode
+import std/streams
+import std/unicode
 
 import types/cell
 import utils/strwidth
diff --git a/src/types/buffersource.nim b/src/types/buffersource.nim
index 9b4e1814..40b0f5a7 100644
--- a/src/types/buffersource.nim
+++ b/src/types/buffersource.nim
@@ -1,7 +1,7 @@
-import options
+import std/options
 
 when defined(posix):
-  import posix
+  import std/posix
 
 import loader/request
 import types/url
diff --git a/src/types/cell.nim b/src/types/cell.nim
index a0ba3459..c7a92c96 100644
--- a/src/types/cell.nim
+++ b/src/types/cell.nim
@@ -1,5 +1,5 @@
-import options
-import tables
+import std/options
+import std/tables
 
 import css/stylednode
 import types/color
diff --git a/src/types/color.nim b/src/types/color.nim
index 5abe1a9e..ea428267 100644
--- a/src/types/color.nim
+++ b/src/types/color.nim
@@ -1,6 +1,6 @@
-import options
-import strutils
-import tables
+import std/options
+import std/strutils
+import std/tables
 
 import bindings/quickjs
 import js/error
diff --git a/src/types/cookie.nim b/src/types/cookie.nim
index f55a150e..82c9d780 100644
--- a/src/types/cookie.nim
+++ b/src/types/cookie.nim
@@ -1,5 +1,5 @@
-import strutils
-import times
+import std/strutils
+import std/times
 
 import io/urlfilter
 import js/error
diff --git a/src/types/referer.nim b/src/types/referer.nim
index 77cb4e4d..40531b59 100644
--- a/src/types/referer.nim
+++ b/src/types/referer.nim
@@ -1,5 +1,6 @@
-import url
-import options
+import std/options
+
+import types/url
 
 type ReferrerPolicy* = enum
   STRICT_ORIGIN_WHEN_CROSS_ORIGIN
diff --git a/src/types/urimethodmap.nim b/src/types/urimethodmap.nim
index 48163668..464c9b69 100644
--- a/src/types/urimethodmap.nim
+++ b/src/types/urimethodmap.nim
@@ -1,7 +1,7 @@
 # w3m's URI method map format.
 
-import strutils
-import tables
+import std/strutils
+import std/tables
 
 import types/opt
 import types/url
diff --git a/src/types/vector.nim b/src/types/vector.nim
index e200cc98..f0a03db5 100644
--- a/src/types/vector.nim
+++ b/src/types/vector.nim
@@ -1,4 +1,4 @@
-import math
+import std/math
 
 type Vector2D* = object
   x*: float64
diff --git a/src/utils/map.nim b/src/utils/map.nim
index 620dec58..e4681c51 100644
--- a/src/utils/map.nim
+++ b/src/utils/map.nim
@@ -1,4 +1,4 @@
-import algorithm
+import std/algorithm
 
 func searchInMap*[U, T](a: openArray[(U, T)], u: U): int =
   when not (typeof(u) is U):
diff --git a/src/utils/mimeguess.nim b/src/utils/mimeguess.nim
index 7477c399..0a65c909 100644
--- a/src/utils/mimeguess.nim
+++ b/src/utils/mimeguess.nim
@@ -1,6 +1,6 @@
-import algorithm
-import streams
-import tables
+import std/algorithm
+import std/streams
+import std/tables
 
 import config/mimetypes
 
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim
index 0168ad63..d7e5a5ba 100644
--- a/src/utils/twtstr.nim
+++ b/src/utils/twtstr.nim
@@ -1,11 +1,14 @@
-import algorithm
-import json
-import math
-import options
-import os
-import strutils
-import tables
-import unicode
+import std/algorithm
+import std/json
+import std/math
+import std/options
+import std/os
+import std/strutils
+import std/tables
+import std/unicode
+
+when defined(posix):
+  import std/posix
 
 import types/opt
 import utils/charcategory
@@ -13,9 +16,6 @@ import utils/map
 
 export charcategory
 
-when defined(posix):
-  import posix
-
 func onlyWhitespace*(s: string): bool =
   for c in s:
     if c notin AsciiWhitespace:
diff --git a/src/version.nim b/src/version.nim
index 7d47fddb..91a085b3 100644
--- a/src/version.nim
+++ b/src/version.nim
@@ -1,6 +1,6 @@
 {.used.}
 
-import macros
+import std/macros
 
 template imp(x: untyped) = import x